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);
... ;-)
如何录制 mp3 广播流?感谢您的任何帮助或代码片段...
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屋!