How to record FM sound in Android?

I need to record songs played by the FM application. I checked MediaRecorder.AudioSource but couldn't find what to use for setAudioSource

Can anybody help me?

thanks Ramachandran.R

+4
source share
2 answers

The Android SDK does not support FM radio. Different device manufacturers may hack their own support for FM radio, but you will need to contact these manufacturers to find out which APIs, if any, for them.

+3
source

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(); 
+2
source

Source: https://habr.com/ru/post/1346058/


All Articles