swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] adding sound with Flash > 6


From: Pablo Rodríguez
Subject: Re: [Swftools-common] adding sound with Flash > 6
Date: Wed, 10 Dec 2008 23:20:59 +0100
User-agent: Thunderbird 2.0.0.18 (X11/20081120)

Chris Pugh wrote:
Pablo,

You're not kidding!!    Not only is your script huge, but the
resulting SWF is to boot!

Thanks for your reply and sorry for the delayed answer.

The presentation is big, since is a real presentation, but it was my fault to show this SWF and script, since the issue is much simpler.

Are you really sure that,

 -  using all those 'times[xx]=yyyyy' statements is the right way to go?

I think that is the best way I have to advance slides at a certain miliseconds. Actually I don't know a better way to do it (I'm afraid I'm not a programmer). If you had a better way to do it, I would be pleased if you can share it with me.

-  embedding such a massive .wav file is sensible?

I embedded the wav file instead of the mp3 file, because swfc compresses wav audio with a better compression rate and a smaller output. Otherwise I couldn't upload the SWF outputs to my website, since my hosting provider only allows files >8000KB and the files with the mp3 embedded were 8.5MB in size.

-  Why not convert to an MP3, then
   loadSound that in instead?  This seems to work in all versions of
the player that I've
   tried thus far, and the added benefit for you, is that folks won't
be in the land of nod
  before your slide presentation even starts!  ;o)

This doesn't work for me. Using

        .sound audio file.mp3
        .action:
                snd = new Sound();
                snd.loadSound("audio",true);
        .end

doesn't find any audio to play. I wonder whether Sound.loadSound might work with audio files embedded in the SWF file itself.

But I'd appreciate the proper method for doing it if this works.

Using '.stop' on it's own kills everything, stone dead.   '.stop
audio' simply stops that
particular sound object. ( check the Flash ActonScript Dictionary or
similar refs ).

I didn't know that the .stop tag (and similar) were referenced in ActionScript guides.

I'm not quite sure what you mean by loop .. that the sound repeats
itself before the
previous one is finished, maybe?

The loop is what happens using "version=7" and ".sound audio "sound.mp3" .stop audio". What happens it that the first half second is played and stopped again and again (I thought this was a loop).

Why not separate out the sound play/stop sections
from the rest to check your coding one more time?   I haven't even
attempted to try your
script ( for obvious reasons ), but the standard start/stop commands
seem to work aok for me,
when both attaching, and loading sounds.   Tested them quite
thoroughly when writing a mini-audio
player script.

The issue is not the ActionScript (or not the slide advancer), but how audio is embedded in versions above 6.

Here is a small script that shows the issue.

.flash bbox=800x600 filename="audio-embed.swf" version=7 fps=1

.sound audio "my_life_changed.mp3"
.stop audio

.action:
    snd = new Sound();
    snd.attachSound("audio");
.end

.frame 1
    .action:
        snd.start(snd.position/1000.0,0);
    .end

.frame 2

.end

And the bug seems to be that when Flash version is above 6 and sound is embedded and stopped as above, when SWF reaches frame 2, it restarts the sound or the presentation itself. This happens if a frame is defined after Sound.start, no matter whether it has contents or not. I happens with both Flash 7 and 10 for Linux, and a file that shows this can be found at http://ousia.justfree.com/audio-embed.swf (2.5MB).

HTH a little.

Many thanks for your help,

Regards,


Pablo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]