MT6589平台通话录音时播放提示音给对方功能的具体实现
程序员文章站
2023-08-12 20:09:41
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; }
上一篇: Android通过LIstView显示文件列表的两种方法介绍
下一篇: 哮喘该如何预防效果最好呢