如何更改循环播放的Clip的音量? [英] how do i change volume of Clip that is playing in loop?

查看:93
本文介绍了如何更改循环播放的Clip的音量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为如何更改已经在循环模式下播放的Clip的音量而烦恼.我目前拥有的代码是:

I am wrecking my brain on how to change the volume of a Clip that is already playing in loop mode. The code I currently have is:

Clip c = currentSound.getClip();
FloatControl gainControl = 
    (FloatControl) c.getControl(FloatControl.Type.MASTER_GAIN);
gainControl.setValue(-10.0f);

currentSound.loop(loopCount);

我是否假设一旦循环开始就无法更改音量,对吗?

Is my assumption that once the loop starts, the volume cannot be changed, true?

推荐答案

我是否假设一旦循环开始就无法更改音量,对吗?

Is my assumption that once the loop starts, the volume cannot be changed, true?

不.如果完全可以更改 Clip 音量,则可以随时更改.

No. A Clip volume can be changed at any time, if it can be changed at all.

这篇关于如何更改循环播放的Clip的音量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆