pgSoundLoader() for dummies

Help for using specific functions

pgSoundLoader() for dummies

Postby Robert Stevenson » Mon Oct 06, 2014 12:58 pm

I simply need the student to be able to click a wee button and play a 3 second .mp3 file. Could some one point me to a graphic that would show the AE setup for such a thing ... I don't want an audioplayer to show ... simply want to link to an .mp3 in a directory "audio".
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: pgSoundLoader() for dummies

Postby Clifton » Mon Oct 06, 2014 3:22 pm

What you need in this scenario is to play your audio transparently. This means that you assign a url and a name to your audio, but the name parameter does not point to any object on the ToolBook page. This tells the function to assign the name to the audio so you can control it with pgSoundControl() if needed, but to only use this name as a reference in memory. In this case no controls will be visible to the user. They will just hear is the audio playing.

Here is a typical setup where clicking the button will play a sound transparently:

Image 1.png
Transparent Audio Playback
Image 1.png (77.01 KiB) Viewed 1370 times

NOTE: In this example, you will need to put all your sounds in a [sounds] directory and flag that folder for inclusion with the export of your book Using the DHTML Export Tree Manager (PowerPac menu > Add Folders to Export Tree). Inside the sounds folder on your hard drive you would place all your mp3 files.

The name parameter can be any name you choose. It can be left blank if you will never need to control the audio with pgSoundControl(). I recommend always assigning a name to keep track of things because you can use pgSoundLoader() to play multiple audio files at the same time (e.g.: background music with foreground voice over audio).
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: pgSoundLoader() for dummies

Postby Robert Stevenson » Mon Oct 06, 2014 4:20 pm

Looks good. Once again ... I am rescued.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: pgSoundLoader() for dummies

Postby Robert Stevenson » Tue Oct 07, 2014 12:24 pm

I knew it couldn't be that easy. All I have in the "playmp3" button is the url_playList parameter of "...sounds/ammonium.mp3"
I have flagged the "sounds" folder to be included on export. When exported however I don't the file to play.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: pgSoundLoader() for dummies

Postby Clifton » Tue Oct 07, 2014 12:50 pm

You may need to put your export on a web server if your system security permission prevent playback of local sound files.
You can change this behavior by visiting this url:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

Make sure the settings look link this:

Image 3.png
Flash Player Security Setting for local file playback
Image 3.png (44.34 KiB) Viewed 1368 times

If the sound still doesn't play, check the exported content to ensure that your sound is really in the exported content AND in the location that the PowerPac is expecting it to be.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: pgSoundLoader() for dummies

Postby Robert Stevenson » Tue Oct 07, 2014 1:25 pm

I do in fact have it loaded to a server ... but will check the settings as well. Strange.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: pgSoundLoader() for dummies

Postby Clifton » Tue Oct 07, 2014 2:03 pm

Looking a little closer at your setup and noticed this is incorrect:
"...sounds/ammonium.mp3"
It should be:
"../sounds/ammonium.mp3"
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: pgSoundLoader() for dummies

Postby Robert Stevenson » Tue Oct 07, 2014 2:16 pm

Sweet! And that did it!
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: pgSoundLoader() for dummies

Postby Robert Stevenson » Tue Oct 07, 2014 9:00 pm

Curious if there is something unique about a multiple choice question object out of the catalog and applying audio feedback to the individual buttons ... for some reason I can't seem to get audio feedback working in these cases.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: pgSoundLoader() for dummies

Postby Clifton » Tue Oct 07, 2014 10:22 pm

You cannot use the audio feedback that is provided within ToolBook as it only accepts wav files.

In order to get this working you have to set actions for on question answered OR on question scored for the group of buttons. The answer parameter determines which item was chosen or you can use either name of target in the url_playList parameter or the keyword answer. I used the answer variation below.

Image 5.png
Image 5.png (47.12 KiB) Viewed 1364 times

Of course you have to have an audio file that corresponds to [answer].mp3
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Next

Return to Function Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron