swftools-common
[Top][All Lists]
Advanced

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

Re: [Swftools-common] wav2swf


From: Chris Pugh
Subject: Re: [Swftools-common] wav2swf
Date: Sun, 19 Jul 2009 12:26:54 +0100

If you'll forgive saying so, that all sounds rather complex!  Browsers which
object to javascript won't play it. And if your .vav happens to be large? Well,
embedding it would crank up file size quite dramatically.

Why not use .mp3 then stream the sound?  Siuggestion code below, which
layers a button over an image. Simply make your own adjustment as and
where appropriate ( watching that 'version='  line, since using 9 or10 causes
issues ):

=================================================

.flash filename="test01.swf" bbox=300x200 version=8 fps=60 compress
    .font tahoma "myfonts/tahoma.ttf"
    .box button_pressed width=30 height=45  line=2 color=salmon
    .box button_idle width=30 height=45 line=2
    .box button_hover width=30 height=45 line=2
    .box button_area width=30 height=45 line=2 fill=salmon
    .jpeg img1 "myimage.jpg" # size matches button

.sprite image
     .put img1 x=?? y=??  # ..and if you need to, scale=??%
.end
 .button play
        .show button_area as=area
        .show button_idle as=idle
        .show button_hover as=hover
        .show button_pressed as=pressed
        .on_press:
         var mySound = new Sound();
         mySound.loadSound("mysound.mp3", true);
            mySound.play();
         .end
.end

.put image  x=?? y=??
.put play   x=?? y=??
.end

=========================================

You could also do sometihing simillar and stream another .swf
inside this one.

HTH somewhat.

Regards,


Chris.

2009/7/19 John Francis Lee <address@hidden>:
> Rereading the wav2swf I noticed a reference to a flashsound.js script that
> purports to give control over flash sound... which is what I want to do.
>
> I found a copy of the code and a tutorial at
>
>  http://www.webwasp.co.uk/tutorials/b19-sound-js/02.php
>
> but I am having no luck getting anything to work. The idea is to load the
> code,
>
>  <script language="JavaScript" src="flashsound.js"></script>
>
> instantiate an instance of FlashSound(),
>
>  <script language="JavaScript">
>  var mysound = new FlashSound( );
>  </script>
>
> embed the desired .swf with the sound you want to hear inside,
>
>  <script language="JavaScript">
>  mysound.embedSWF("Sound.swf");
>  </script>
>
> and then to start and stop the sound using onMouseover and onMouseout events
> trapped in an <a></a> tag which call functions like
>
>  mysound.gotoAndStop('/SoundPlayer', 'start')
>
> and
>
>  mysound.gotoAndStop('/SoundPlayer','stop')
>
> The identity of '/SoundPlayer' escapes me, as do 'start', and 'stop'.
>
> I used the -S option to wav2sdf as suggested, thinking that that might
> define 'start' and 'stop', but still no joy.
>
> I can see the object in the dom via firebug, so it's loading with its
> inherited functions, but nothing happens when it should.
>
> Any insight appreciated. This seems like some pretty antique code, c. 2001,
> 2002.
>
> John Francis Lee wrote:
>>
>> Chris Pugh wrote:
>>>
>>> Hi John,
>>>
>>> Sounds like your original .wav file is corrupt in some way.  Is it?
>>> Does it play normally otherwise?  If so, in what?  Which program
>>> was used to create it, and what codec format has been used?
>>
>> I don't know that it was 'corrupt', it did play in audacity and in totem
>> movie player, which is what pops up if I double clicked the file on my
>> ubuntu machine, but it would not play well in audacious... I used the gnome
>> sound recorder to create it, choosing simply '.wav' format. I had thought
>> that the gnome sound recorder was just a gui for sox, but it is not...
>>
>>> See,
>>>
>>>  http://en.wikipedia.org/wiki/WAV
>>>
>>> for a confusing array!
>>
>> I've spared myself more confusion thus far... perhaps I'll have a look at
>> this point.
>>
>>> How about posting the offending audio file for testing?
>>
>> I had done so... but no point now that I've found my problem...
>>
>>> On another tack entirely, why convert the wav to swf
>>> in the first place?
>>
>> I wanted to have an .swf file play when I clicked on an imagemap, and
>> that's what happens, now that I'm able to use wav2awf to make an .swf from
>> the .wav... but my browser, firefox, goes to a blank page when it does so...
>> which defeats my original purpose.
>>
>>>
>>> Finally, if you don't already use it, Sox,
>>>
>>>   http://sox.sourceforge.net/
>>>
>>> is one of the best audio manipulation suites around.
>>> It may help you considerably.
>>
>> Yes. I had thought that sox was the undergirding of gnome sound recorder
>> but it is not. In fact sox was not even installed on my system!
>>
>> After I installed sox I played the offending .wav file using sox and,
>> after playing the file, sox commented that the file was missing an EOF.
>>
>> So I used sox to make another .wav file from the original... and sox
>> supplied the missing EOF... and wav2swf no longer choked but simply told me
>> that I had not compiled it with streaming .mp3 support... which I then
>> did... and now wav2swf performs just as advertised and creates the .swf! But
>> it doesn't play as I imagined it would... in the "backgound" with the page
>> with the imagemap remaining in view.
>>
>>>
>>> Regards,
>>>
>>>
>>> Chris.
>>
>> So thanks for the help!
>>
>> Do you have any idea how I might accomplish my original aim, which is to
>> have the page with the imagemap remain while the .wav /.mp3 /.swf /.whatever
>> file plays when clicked?
>>
>> I also had not realized that you must explicitly include the address of
>> the list when replying to a posting... so now a I have done so.
>>
>>>
>>>> 2009/7/18 John Francis Lee <address@hidden>:
>>>> Hello,
>>>>
>>>> I'm trying to make an .swf file from a .wav file so that I can click on
>>>> a
>>>> face in a photo with an associated imagemap and hear the contents of the
>>>> .wav file.
>>>>
>>>> But when I type.
>>>>
>>>> address@hidden:$ wav2swf -o welcome-adiphong.swf welcome-adiphong.wav
>>>>  wav_read: warning - short file (2146398192 bytes missing)
>>>>  Out of memory (2147418112 bytes needed)FATAL   Error reading
>>>> welcome-adiphong.wav
>>>>
>>>> The man page doesn't give much guidance and the only thing I find at the
>>>> wiki is the man page. Going to the home page itself is uninformative as
>>>> there are no further links from there.
>>>>
>>>> Any help appreciated.
>>>>
>>>> --
>>>> John Francis Lee
>>>> 1025/37 Thanon Jet Yod
>>>> Mueang Chiangrai 57000
>>>> Thailand
>>>>
>>>>
>>>>
>>>
>>
>>
>
>
> --
> John Francis Lee
> 1025/37 Thanon Jet Yod
> Mueang Chiangrai 57000
> Thailand
>




reply via email to

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