【问题标题】:When playing back sounds the more sounds that play at once the higher pitch and louder they seem to get播放声音时,同时播放的声音越多,音调越高,声音越大
【发布时间】:2013-07-27 03:46:09
【问题描述】:

当我使用基本的播放声音时,基本上是标题所说的

mySound= new Sound(); 
c = new SoundChannel();
c = mySound.play();

这是在设置为 mp3 以进行测试的类中。我确实让它产生声音,但将其设置为 mp3 以测试音高问题。当相同的声音仍在播放时,它被调用的次数越多,它似乎也变得越来越响亮。我认为这是不同渠道的重点?有没有同样的方法可以用混音器或其他东西来解决这个问题?谢谢

请不要仅仅因为你不明白我的要求而投反对票,我最近经常看到这种情况发生。

【问题讨论】:

    标签: actionscript-3 flash


    【解决方案1】:

    mySound.play() 正在返回一个新的 SoundChanel。

    c = new SoundChannel();
    c = mySound.play();
    

    您在这里所做的是将一个新的 SoundChanel 分配给 c,之后,您将它分配给另一个新的 SoundChanel。

    并且为 c 分配一个新的 SoundChanel 不会使前一个消失。它仍然存在(an 这样播放),但 c 不再引用它。

    试试这个:

    if(c!=null) // if c has previously be assigned a soundchanel (that might be playing), stop it
     c.stop();
    
    c = mySound.play(); // assign new SoundChanel to c and play it
    

    【讨论】:

    • 嗯,你说得对,我很马虎,但它仍然没有解决问题
    • @RustyH 你必须将 soundChannel (c) 声明为你的类中的一个字段。您应该发布更多代码。也许是整个班级。球场没有上升。不要使用你不理解的词。当声音在其之前的副本之上播放时,音量会上升。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多