在Android上记录音频的MediaPlayer源?音频、Android、MediaPlayer

2023-09-06 01:40:18 作者:全世界宣布爱你。

在Android上,你可以记录使用的MediaRecorder类麦克风音频: MediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);

On Android, you can record audio from the microphone using the MediaRecorder class: MediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);

我想记录所起一个的MediaPlayer实例,而不是(或一些其他音频回放装置)的音频的某些部分。那可能吗?我将如何设置自定义音频源?

I want to record some parts of audio being played by a MediaPlayer instance instead (or some other audio playback device). Is that possible? How would I set a custom audio source?

要总结; 如何流音频到MediaRecorder从任意音源?

推荐答案

我不认为这是对于一个API现在。虽然它是可能的话,你就必须有访问设备的缓冲区,下至内核/硬件水平。即使你找到一个方式,我不认为Android会容许你这样做的应用水平。

I don't think there is an API for that for now. Though it IS possible, you would have to have access to the device's buffer, down to the kernel/hardware level. Even if you find a way, I don't think Android would give you permission to do this on application level.

 
精彩推荐
图片推荐