Android的:如何录制MP3广播(音频)流音频、Android

由网友(热血大帅逼)分享简介:我最喜爱的广播电台播放的MP3格式的无线音频流。在我的Andr​​oid应用程序,我可以接收并播放没有任何问题。My favorite Radio station plays a radio audio stream in mp3 format. In my android application I can rec...

我最喜爱的广播电台播放的MP3格式的无线音频流。在我的Andr​​oid应用程序,我可以接收并播放没有任何问题。

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收音机流,以我的Andr​​oid手机的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...

Android开发者:MediaRecorder

...

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.

阅读全文

相关推荐

最新文章