Skip to content

Choppy sound when SoundStreamBlock isn't in every frame #3817

@desuwa

Description

@desuwa

FFmpeg sometimes generates swf files without a SoundStreamBlock tag in each frame. This causes Ruffle to constantly interrupt the audio stream.

Commenting out the lines below fixes the issue but I'm not sure what side effects it'll have elsewhere. It looks like it's safe to remove though.

// If we are playing a streaming sound, there should(?) be a `SoundStreamBlock` on each frame.
if !has_stream_block {
self.0.write(context.gc_context).stop_audio_stream(context);
}

Also, I wonder if stopping the stream like this doesn't cut off the audio too early sometimes just before the stream ends (previous frame data is still playing but the next frame doesn't have a SoundStreamBlock tag).

test swf:
sound_stream_block.zip
looks like this mostly happens with high fps videos (60fps here).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions