SoFunction
Updated on 2025-03-02

The specific implementation of the function of playing prompt sound to the other party when recording a call on the MT6589 platform

1. Modify 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:
Modify pBGSPlayer->Open(pSpeechDriver, 0x0, 0xFF); is pBGSPlayer->Open(pSpeechDriver, 0xFF, 0xFF);

2. Modify
a. Add: import;
b. Add member: private ToneGenerator mToneGenerator;
c. Modify the function private void onRecordClick(MenuItem menuItem)
Added before startRecord();
mToneGenerator = new ToneGenerator(AudioManager.STREAM_MUSIC, 240);
setVolumeControlStream(AudioManager.STREAM_MUSIC); (24, 1000);
d. Modify the function private void stopRecord() to add:
if (mToneGenerator != null) { (); mToneGenerator = null; }