gpt4 book ai didi

android - 如何更改声音的输出音量?

转载 作者:行者123 更新时间:2023-12-03 00:20:49 27 4
gpt4 key购买 nike

我正在使用此代码播放声音。

我想让用户能够更改声音的音量。你能告诉我怎么做吗?

NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification();
notification.sound = Uri.parse("android.resource://emad/raw/quarter");

谢谢。

真的
埃玛德

最佳答案

使用

  notification.audioStreamType = AudioManager.STREAM_MUSIC;

context.setVolumeControlStream(AudioManager.STREAM_MUSIC);

关于android - 如何更改声音的输出音量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7337481/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com