Skip to content

core: Queue up Sound and SoundChannel methods during loading #9457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2023

Conversation

Aaron1011
Copy link
Member

Flash supports calling Sound.play, SoundChannel.stop, and SoundChannel.soundTransform while a sound load is in progress (e.g. immediately after calling Sound.load).

To support this, we queue up information inside SoundObject and SoundChannelObject when a load is in progress. When a load completes, we trigger any queued Sound.play and SoundChannel.stop calls, and apply the most recent SoundChannel.soundTransform

@SN902
Copy link

SN902 commented Feb 7, 2023

Kingdom rush, dash_fly_by_futzi01-d9flryk.swf and most htpot NSWF stuff, now crashes with errors in this commit:

Cannot access property:: close of null or undefined
Cannot access property:: addeventListener of null or undefined
Cannot access property:: smoothing of null or not undefined

@Aaron1011
Copy link
Member Author

@SN902 Is that a regression, or were those swfs previously crashing earlier?

@SN902
Copy link

SN902 commented Feb 7, 2023

@Aaron1011 on latest master works without issues, these swf's spam alot of these errors in console, but not permanently stops emulator

@Aaron1011
Copy link
Member Author

@SN902 I've updated the PR to fix the issue - I left in a panic! by accident.

@SN902
Copy link

SN902 commented Feb 7, 2023

@Aaron1011 issue solved

@ousia
Copy link
Contributor

ousia commented Feb 8, 2023

@Aaron1011,

I wonder whether this PR may also be considered to fix #6673 (or it is a totally unrelated issue).

Many thanks for your help.

@Aaron1011
Copy link
Member Author

@ousia I think that issue is unrelated - with this PR, loading is still all-or-nothing (we never report streaming/partial loads to AVM2), so it won't affect Sound.duration.

@ousia
Copy link
Contributor

ousia commented Feb 9, 2023

@Aaron1011, many thanks for your reply.

It would be great that Sound.position() and Sound.duration() are consistent with non-standard frame rates.

I hope this can be achieved in the future.

Many thanks for your contributions to Ruffle (and to all contributors for their work).

@Aaron1011 Aaron1011 enabled auto-merge (rebase) February 11, 2023 17:27
Flash supports calling `Sound.play`, `SoundChannel.stop`, and
`SoundChannel.soundTransform` while a sound load is in progress
(e.g. immediately after calling `Sound.load`).

To support this, we queue up information inside `SoundObject`
and `SoundChannelObject` when a load is in progress. When a load
completes, we trigger any queued `Sound.play` and `SoundChannel.stop`
calls, and apply the most recent `SoundChannel.soundTransform`
@Aaron1011 Aaron1011 merged commit 9bce6b7 into ruffle-rs:master Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants