1.修改AudioMTKStreamOut.cpp ssize_t AudioMTKStreamOut::write(const void *buffer, size_t bytes)
{
case android_audio_legacy::AudioSystem::MODE_IN_CALL:
case android_audio_legacy::AudioSystem::MODE_IN_CALL_2:
修改pBGSPlayer->Open(pSpeechDriver, 0x0, 0xFF); 為pBGSPlayer->Open(pSpeechDriver, 0xFF, 0xFF);
2.修改InCallScreen.java
a.添加: import android.media.ToneGenerator;
b. 添加成員:private ToneGenerator mToneGenerator;
c. 修改函數 private void onRecordClick(MenuItem menuItem)
在 startRecord(); 之前添加:
mToneGenerator = new ToneGenerator(AudioManager.STREAM_MUSIC, 240);
setVolumeControlStream(AudioManager.STREAM_MUSIC); mToneGenerator.startTone(24, 1000);
d.修改函數 private void stopRecord() 添加:
if (mToneGenerator != null) { mToneGenerator.release(); mToneGenerator = null; }