Modifying in-call voice playback in Android custom ROM

后端 未结 1 1536
野趣味
野趣味 2021-01-31 13:04

I would like to modify Android OS (official image from AOSP) to add preprocessing to a normal phone call playback sound.

I\'ve already achieved this filtering for app aud

相关标签:
1条回答
  • 2021-01-31 13:47

    There are several possible issues that come to my mind. The blank buffer might indicate that you have the wrong source selected. Also since according to https://developer.android.com/reference/android/media/AudioRecord.html#AudioRecord(int,%20int,%20int,%20int,%20int) you might not always get an exception even if something's wrong with the configuration, you might want to confirm whether your object has been initialized properly. If all else fails, you could also do an "mRecord.setPreferredDevice(AudioDeviceInfo.TYPE_BUILTIN_EARPIECE);" to route the phone's built-in earpiece directly to the input of your recorder. Yeah, it's kinda dirty and hacky, but perhaps suits the purpose.

    The other thing what was puzzling me that instead of using the builder class you've tried to configure the object directly via its constructor. Is there a specific reason why you don't want to use AudioRecord.Builder (there's even a nice example at https://developer.android.com/reference/android/media/AudioRecord.Builder.html ) instead?

    0 讨论(0)
提交回复
热议问题