简体   繁体   English

如何在Android中录制FM音频?

[英]How to record an FM audio in android?

i need to record the songs being played by a FM app. 我需要录制FM应用播放的歌曲。 I checked the MediaRecorder.AudioSource but could not find what to use for setAudioSource 我检查了MediaRecorder.AudioSource但找不到用于setAudioSource的内容

can anyone please help me? 谁能帮帮我吗?

thanks, Ramachandran.R 谢谢,Ramachandran.R

There is no FM radio support in the Android SDK. Android SDK中没有FM收音机支持。 Various device manufacturers may have hacked in their own FM radio support, but you would have to contact those manufacturers to learn what APIs, if any, they have for them. 各种设备制造商可能已经破解了他们自己的FM无线电支持,但您必须联系这些制造商以了解他们拥有的API(如果有的话)。

try this code 试试这段代码

    int audioSource = MediaRecorder.AudioSource.VOICE_DOWNLINK;  
    int sampleRateInHz = 8000;  
    int channelConfig = AudioFormat.CHANNEL_CONFIGURATION_MONO;  
    int audioFormat = AudioFormat.ENCODING_PCM_16BIT;  
    bufferSize = AudioRecord.getMinBufferSize(sampleRateInHz,  
            channelConfig, audioFormat);  
    AudioRecord recordInstance = new AudioRecord(audioSource,  
            sampleRateInHz, channelConfig, audioFormat, bufferSize);  
    recordInstance.startRecording();  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM