bugGnash - The GNU Flash player - Bugs: bug #33323, Gnash plays sound in Flash7 file...


bug #33323: Gnash plays sound in Flash7 file un-continually

Submitted by:  Nutchanon Wetchasit <nachanon>
Submitted on:  Mon May 16 08:38:42 2011  
Votes:  50  
Category: soundSeverity: 3 - Normal
Release: 0.8.9Status: Confirmed
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Sat Mar 3 15:16:00 2012, comment #12:

Now I got a different way to pinpoint this.

I looked at the original sound used in making of gears.swf, it virtually has no silence period.
But sound extracted from gears.swf, I found out that it has ~100 ms slience gap at the beginning and ending.

When I compare this extracted sound side-by-side with ones recorded during gnash (0.8.10) playing gears.swf;
it matched, thus gnash is playing a raw sound data (which includes spaces).

So I manually applied SeekSamples and SoundSampleCount on the extracted sound data.
I found that this precisely clips the gap out both on the start and at the end.
This clipped sound played continuously, like Macromedia Flash Player do.

Summed up: I think SeekSamples+SoundSampleCount functionality were needed to play the sound correctly.

Note #1: The attached file (gears-sounds.zip) contains
peak-graph of sounds and comparision in my experiment (sounds.png),
the original sound (gears-original.wav),
extracted sound (gears-extracted.wav),
looped version of extracted sound (gears-extracted.loop.wav),
clipped (applied SeekSamples+SoundSampleCount) version of extracted sound (gears-clipped.wav),
clipped and looped version of extracted sound (gears-clipped.loop.wav) aka. the final result.

Note #2: These experiments were done under sound editor, which allowed me to do them only down to millisecond precision, enough to demonstrate what these parameters do, but it's not sample-by-sample accurate.

(file #25257)

Nutchanon Wetchasit <nachanon>
Sat Mar 3 06:36:28 2012, comment #11:

This's still a problem on Gnash 0.8.10, with the same result.

Gnash: gnash_0.8.10-1~lenny (from getgnash.org APT repository)
System: Debian GNU/Linux 5.0 Lenny, i386

Nutchanon Wetchasit <nachanon>
Sun May 29 04:48:14 2011, comment #10:

I just checked gears.swf's sound embedding in source fla file, it wasn't a "Sync: Stream", but a "Sync: Start".
Sorry for my mistake on the first post.

Nutchanon Wetchasit <nachanon>
Wed May 18 21:14:23 2011, comment #9:

I take the SeekSamples immunity back. I was wrong, SWFMill didn't strip that value. The thing is that swfmill doesn't make it easy to tweak that value, but hacking it at random shows it does make a difference, enough to make the pp also play the gap...

Sandro Santilli <strk>
Project Member
Wed May 18 19:47:17 2011, comment #8:

Sorry, 5182 is 1/32 and gives you the gap, while 10364 doesn't give you the gap.

Sandro Santilli <strk>
Project Member
Wed May 18 19:09:24 2011, comment #7:

For the record: 1/16 of it is 2591, doubling it gets the gap back

Sandro Santilli <strk>
Project Member
Wed May 18 18:54:55 2011, comment #6:

The problem seems to be with the start of decoding data:
decodedDataSize: 165824

Setting _inPoint to 1/16 of that makes the sound come out smooth.

Sandro Santilli <strk>
Project Member
Wed May 18 17:55:22 2011, comment #5:

I've verified it is not the seekSamples, as it still behaves that way when SeekSamples are removed trough swfmill (and adobe player still makes no pause).

This is a looping sound, and the "gap" is between loops.
There might be an initial or final silence in the samples returned by the decoders, but both gst and ffmpeg behave the same (gst might be using ffmpeg anyway actually).

Sandro Santilli <strk>
Project Member
Tue May 17 21:36:11 2011, comment #4:

Note that gnash doesnt' support the "Mp3: SeekSamples 1670" part, so if the mp3 starts with 1670 silent samples we could have an explanation for this. Haven't checked more closely yet.

Sandro Santilli <strk>
Project Member
Tue May 17 21:32:42 2011, comment #3:

This is actually not a streaming sound but an event sound,
here's an extract from the gears.swf dumping using Ming's listswf:

Block length: 4

PlaybackSoundRate 22 kHz
PlaybackSoundSize 16 bit
PlaybackSoundType stereo
StreamSoundCompression uncompressed
StreamSoundRate 5.5 kHz
StreamSoundSize 8 bit
StreamSoundType mono
StreamSoundSampleCount 0

Offset: 3615 (0x0e1f)
Block type: 14 (SWF_DEFINESOUND)
Block length: 7705

CharacterID: 13
SoundFormat: MP3
SoundRate: 22 KHz
SoundSize: 16-bit
SoundType: Stereo
SoundSampleCount: 18672
Mp3: SeekSamples 1670

Offset: 11330 (0x2c42)
Block type: 15 (SWF_STARTSOUND)
Block length: 5

SoundId 13
SyncStop: No
SyncNoMultiple: Yes
HasEnvelope: No
Loops: 32767


Sandro Santilli <strk>
Project Member
Mon May 16 12:26:33 2011, comment #2:

This may also be a duplicate of bug #24481

Sandro Santilli <strk>
Project Member
Mon May 16 08:56:34 2011, comment #1:

See also bug #33294 which seems to be a duplicate of this

Sandro Santilli <strk>
Project Member
Mon May 16 08:38:42 2011, original submission:

Hello, I'm using gnash 0.8.9-1~lenny from getgnash.org apt repository.
When playing my dummy flash file created from Flash MX 2004 (Flash 7)
background sound that's supposed to repeat continuously,
just plays for 1 sec, stops and restarted, and things repeated again.
Animation plays fine, though.

This is a 'correct' result from Macromedia Flash Player 7
(You will notice that sound play all along the animation)

This is a video result from Gnash
(You will notice that sound play,stop,play,stop,... all along)

This is my dummy flash file (created from Flash MX 2004), also attached here.

System: Debian GNU/Linux 5.0 Lenny on i386

Note: Sound was embedded in timeline as 'stream'

Nutchanon Wetchasit <nachanon>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #25257:  gears-sounds.zip added by nachanon (1023kB - application/zip - SeekSamples and SoundSampleCount experiment on gears.swf)
file #23408:  gears.swf added by nachanon (17kB - application/x-shockwave-flash - Dummy test flash file (Flash 7))


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by nachanon (Voted in favor of this item)
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by nachanon (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 50 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Aug 19 04:23:45 2012nachanonCarbon-Copy-=>Added nachanon
    Sat Mar 3 15:16:00 2012nachanonAttached File-=>Added gears-sounds.zip, #25257
    Mon May 16 12:25:42 2011strkCategoryNone=>sound
    Mon May 16 08:38:42 2011nachanonAttached File-=>Added gears.swf, #23408

    Back to the top

    Powered by Savane 3.1-cleanup1