Android的:如何录制MP3广播(音频)流 [英] Android: How to record mp3 radio (audio) stream
问题描述
我最喜爱的广播电台播放的MP3格式的无线音频流。在我的Android应用程序,我可以接收并播放没有任何问题。
My favorite Radio station plays a radio audio stream in mp3 format. In my android application I can receive and play it without any problem.
我如何能实现录音功能?我想要录制的MP3收音机流,以我的Android手机的SD卡。
How can I implement a recording function? I want to record the mp3 radio stream to my Android phones SD-Card.
我试过MediaRecorder类没有任何结果......
I tried the MediaRecorder Class without any result...
...
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
...
不幸的是我不能选择这样的:
Unfortunately I cannot choose something like:
mRecorder.setAudioSource(MediaRecorder.AudioSource.MP3_STREAM);
...; - )
mRecorder.setAudioSource(MediaRecorder.AudioSource.MP3_STREAM);
... ;-)
我如何录制的MP3收音机流?感谢您的帮助或code片段...
How can I record a mp3 radio stream? Thanks for any help or code snippets...
推荐答案
也许你应该逐字节读取的音频数据流,然后将其放入新的文件吗?就像一个简单的文件复制操作,使用的InputStream,OutputStream中。
Maybe you should read audio stream "byte by byte" and then place it into new file? Like a simple file copy operation, using inputstream-outputstream.
这篇关于Android的:如何录制MP3广播(音频)流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!