我需要在循环的每一次迭代中为右耳和左耳设置不同的音量。我用两个声道来表示左右耳的声音,每个声道一个。在
但是,根据文档,每次调用set_volume时,它会将volume设置为先前值的百分比。在
channel1.set_volume(0.0, 0.5) # sets at 0.5
channel1.set_volume(0.0, 0.5) # sets at 0.5 * 0.5 = 0.25
我现在通过打电话来避免这个问题频道播放在循环的每次迭代中,都会将卷重置为1。不过,它也只是在每次迭代时重新启动声音文件。有更好的方法吗?在
^{pr2}$还有一个类似的问题(Setting volume globally in pygame.Sound module)。我试着控制两个不同声音变量的音量,但是左右耳的音量没有变化
如果这在pygame中是不可能的,那么您知道在其他python声音库中这是可能的吗?在
谢谢你
我通过为每个通道分配一个声音对象并设置该声音对象的音量来控制音量
相关问题 更多 >
编程相关推荐