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

 
 

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

Submitter:  Nutchanon Wetchasit <nachanon>
Submitted:  Mon 16 May 2011 08:38:42 AM UTC
Votes: 50
 
Category:  sound Severity:  3 - Normal
Release:  0.8.9 Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 03 Mar 2012 03:16:00 PM UTC, 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 03 Mar 2012 06:36:28 AM UTC, 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 29 May 2011 04:48:14 AM UTC, 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 18 May 2011 09:14:23 PM UTC, 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>
Group Member
Wed 18 May 2011 07:47:17 PM UTC, comment #8: 

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

Sandro Santilli <strk>
Group Member
Wed 18 May 2011 07:09:24 PM UTC, comment #7: 

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

Sandro Santilli <strk>
Group Member
Wed 18 May 2011 06:54:55 PM UTC, 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>
Group Member
Wed 18 May 2011 05:55:22 PM UTC, 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>
Group Member
Tue 17 May 2011 09:36:11 PM UTC, 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>
Group Member
Tue 17 May 2011 09:32:42 PM UTC, 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 type: 45 (SWF_SOUNDSTREAMHEAD2)
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
  SoundInfo:
    SyncStop: No
    SyncNoMultiple: Yes
    HasEnvelope: No
    Loops: 32767



Note that the SWF_SOUNDSTREAMHEAD has no corresponding SWF_SOUNDSTREAMBLOCK

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

This may also be a duplicate of bug #24481

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

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

Sandro Santilli <strk>
Group Member
Mon 16 May 2011 08:38:42 AM UTC, 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.

http://www.mediafire.com/?3a3lxxl7iek3w90
This is a 'correct' result from Macromedia Flash Player 7
(You will notice that sound play all along the animation)

http://www.mediafire.com/?fzzbj9ttt7nz3s8
This is a video result from Gnash
(You will notice that sound play,stop,play,stop,... all along)

http://www.mediafire.com/?qq1r0vkic3y3e3b
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 Files:
   
   
Comment:
   

Attached Files
file #25257:  gears-sounds.zip added by nachanon (1023KiB - application/zip - SeekSamples and SoundSampleCount experiment on gears.swf)
file #23408:  gears.swf added by nachanon (17KiB - 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
  • -email is unavailable- added by nachanon (Voted in favor of this item)
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by nachanon (Submitted the item)
  •  

    There are 50 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-08-19 nachanon Carbon-Copy- Added nachanon
    2012-03-03 nachanon Attached File- Added gears-sounds.zip, #25257
    2011-05-16 strk CategoryNone sound
        StatusNone Confirmed
    2011-05-16 nachanon Attached File- Added gears.swf, #23408

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code