MT6589平台通话录音时播放提示音给对方功能的具体实现
程序员文章站
2023-12-01 19:32:34
1.修改audiomtkstreamout.cpp ssize_t audiomtkstreamout::write(const void *buffer, size_t...
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; }
{
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; }