ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.66k stars 813 forks source link

[Time Mission] Sound distortion when entering the screen in certain ways #6424

Open Jmousy opened 2 years ago

Jmousy commented 2 years ago

Describe the bug

In Time Mission, sound distortion may occur in certain screens.

time-mission.zip

When i start the game in Ruffle, instead of playing background music, it plays an endless ripped distortion sound.

Generally, starting the game doesn't reproduce the problem, but it does occur when the game is started with the following specific process:

How to reproduce

  1. (Loading screen) Click 'Play'
  2. (Title screen) Click 'HELP'
  3. (Help screen) Click 'Skip Intro' in the upper left corner
  4. (Level Select screen) Click 'START (LEVEL 3)' at the bottom center of the character

Adobe Flash Player (Original)

https://user-images.githubusercontent.com/75052171/157409891-0346fe30-09af-4bea-91a3-afcf4d29d183.mp4

Ruffle Nightly 2022-03-07 (❗ Beware of loud sounds.)

https://user-images.githubusercontent.com/75052171/157409907-53b73dd9-9659-48a8-9866-722e4cb683df.mp4

Expected behavior

The correct background music or sound effects should play.

Affected platform

Self-hosted version

Operating system

Windows 10 21H2

Browser

Google Chrome 99

Additional information

No response

relrelb commented 2 years ago

Seems like the function play_music1 in \frame 3\DoAction is called repeatedly in Ruffle, while it's called only once in Flash. play_music1 is invoked using ggg = setInterval(play_music1,30);, but the interval should be disabled after one call:

function play_music1() {
    boxmusic.gotoAndPlay("music2");
    clearInterval(ggg);
}

Due to the repeating clearInterval: Timer 3 does not exist logs, I suspect this stems from a bug in Ruffle's clearInterval implementation, which I don't fully understand yet.

turicfr commented 7 months ago

This was fixed by #14352.