ruffle-rs / ruffle

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

fl0w: Sounds do not play #12685

Open n0samu opened 1 year ago

n0samu commented 1 year ago

Describe the bug

Download the game: fl0w.zip Also available online here.

Fl0w (or Flow) seems to be playable, but none of the sounds play. This seems to be because the game thinks the sounds are finished downloading before they actually are, and moves on to request the next one, leading to a flood of requests, and to Sound.start being called too early. Warnings shown are:

WARN run_frame: ruffle_core::stub: Encountered stub: AVM1 Sound.getBytesTotal()
WARN run_frame: ruffle_core::stub: Encountered stub: AVM1 Sound.getBytesLoaded()
WARN run_frame: ruffle_core::avm1::globals::sound: Sound.start: No sound is attached

Also. the Ruffle desktop app spams these warnings during sound loading:

WARN isahc::handler: request completed with error: unknown error
WARN isahc::handler: request completed with error: failed to connect to the server

I think that may simply be because it tries to fire off more requests at a time than it can handle.

Expected behavior

The game should load only one sound at a time and shouldn't try to play a sound that hasn't loaded yet. The game compares getBytesLoaded() and getBytesTotal() for each sound to determine if it's done loading (and the next sound can be loaded). Ruffle has these functions stubbed to always return 1, leading to the weird behavior mentioned.

Affected platform

Desktop app

Operating system

Windows 10

Browser

No response

Additional information

No response

droserasprout commented 3 months ago

I have found another affected game, Flash Guitar Hero Online. The same behavior and logs on Ruffle 0.1.0-nightly (1c8e95a061a40ccd4b2fdca30a66eb7cc2fbe12d 2024-07-19).