-
-
Notifications
You must be signed in to change notification settings - Fork 882
audio: Implement Sound.position #5482
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
Conversation
* Change `AudioBackend::get_sound_position` to return `f64` to match `AudioBackend::get_sound_duration`. * Wire up `AudioBackend::get_sound_position` to `Sound.position`. * Remove unimplmeneted warning from `Sound.position`.
For some reason, #340 doesn't look like it's fixed to me. If I press pause, then press it again to resume, it starts again from the beginning of the "chapter". Same thing on both web and desktop. |
We probably should also unstub AVM2 |
Conductor game.zip |
Thanks! This is indeed still broken because of some other issue (I suspect a goto issue). |
Whoops, it's dumber than I thought. Since #340 was created with a third party tool, it naturally does weird stuff and uses this property even though it's a v5 SWF. It should be working now. |
Even though they were added in SWFv6, they will be available when playing a v5 SWF in Flash Player 6 and higher. See #340 for an example in the wild.
Fix various issues with `SoundChannel`: * Change `avm2::Object::as_sound_instance` to `as_sound_channel`. * Cache sound position in `SoundChannelObject`. * `SoundInfo::in_sample` is in units of 44100Hz. * Clamp `num_loops` to 1.
Implement
AudioBackend::get_sound_position
and wire it into AVM1Sound.position
.AudioMixer
backend re-organzied with aStream
trait that allows getting the sample position of the underlying decoder.AudioContext.currentTime
when a sound starts playing, and uses this to estimate the current position by comparing toAudioMixer.getOutputTimestamp()
.Fixes #340, #1898.
#2235 partially fixed (but seems to have some other issues, I think it's another case of variables persisting on unloaded clips).