ringtone是Android声音的分类一种代表铃声
正常市面上的机器大多响铃是耳机和喇叭一起出声,根据Android源生逻辑
当然也可以修改hardware层的输出设备的策略,让铃声直走耳机的设备通路
高通架构对应在
snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *out)
{
…
f (devices == (AUDIO_DEVICE_OUT_WIRED_HEADPHONE |
AUDIO_DEVICE_OUT_SPEAKER)) {
if (my_data->external_spk_1)
snd_device = SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1;
else if (my_data->external_spk_2)
snd_device = SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2;
else if (is_active_voice_call)
snd_device = SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES;
else {
//选择耳机的通路,源生的是SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES
snd_device = SND_DEVICE_OUT_HEADPHONES;
ALOGD(" split in \n");
//snd_device = SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES;
}
} else if (devices == (AUDIO_DEVICE_
Android ringtone
最新推荐文章于 2023-06-16 10:36:53 发布