|
|
Ambient sound player/audio mixer plugin for Flash Panorama Playeria_ambientmix manages a set of sound loops so that background audio mixes can be dynamically controlled from xml. Contributed by FPP forum user Rick Workman. Version 1.0, free. The set of loops to be mixed is defined by plugin parameters; the parameter name <panorama>
<parameters> panoName=Pan1 panoType=mov layer_10 = plugins/ia_ambientmix.swf </parameters> <ia_ambientmix> traffic=Sounds/traffic.mp3 crowd=Sounds/CrowdNoise.mp3 wind=Sounds/Wind.mp3 </ia_ambientmix> <hotspots> . . . </hotspots> </panorama> Defining a new set of loops in an xml file causes the previous ones to be discarded. All sounds are played as infinite loops. This plugin has a single assignable attribute ("mix") (see your FPP documentation for more info on "Assignments and motion tweens"). The below: The "mix" attribute is used to set a new mix of audio loops. The value of a mix is a sequence of pairs of the form loopName:volume where loopName is the name of the loop defined in the plugin parameters and volume is a value between 0 and 1. Examples: Please leave comments or questions below! DOWNLOAD (includes ia_video Video Player Plugin)
|
New forum topicsRecent commentsWho's onlineThere are currently 0 users and 2 guests online.
|
Wow, both ia_video and
Wow, both ia_video and ia_ambientmix look really useful
I'm going to give it a try
Thanks
GoGoPaulo: I hope you can
GoGoPaulo: I hope you can give them a workout. I can be sometimes be fixated on solving my own problems, and miss the larger picture. I'm also focused on offline usage, so I'd be interested in any experience with Web applications. And a critique of the crude documentation would also be useful; I'm thinking I should do another iteration on this anyway.
Rick
February 22, 2008: Updated
February 22, 2008: Updated to v1.0a (expanded documentation)
Hi Rick: I'm having a little
Hi Rick:
I'm having a little difficulty getting things to work...
I'm testing locally.
Attempt 1:
MiraculousMandarin="http://blah.com/MiraculousMandarin.mp3"
</ia_ambientmix>
This resulted in an error, that the file wasn't found. Further testing makes me think that it is because of the quote marks around the URL.
Attempt 2:
MiraculousMandarin=local/path/to/MiraculousMandarin.mp3
</ia_ambientmix>
Results in the MP3 being accessed A-OK, once I remove the quote marks.
With the above, I put this in the

globalelement:onStart="ia_ambientmix.mix=MiraculousMandarin:0.8"But I didn't hear anything.
Trying this:
onStart="external.ia_ambientmix.mix=MiraculousMandarin:0.8"Still brings me no joy.
Ideas? I'm sure I'm missing the obvious.
Thanks!
Patrick
Hi, Can we see an online
Hi,
Can we see an online demo?
Thanks!
Hi Patrick, Thanks for
Hi Patrick,
Thanks for helping to thrash this out.
1. You don't need quotes around the URL. I thought I'd put in code to remove them, but just realized the XML parser had already replaced them with " . I'll try and make this a bit more robust in the next version, but not quite sure what the best approach should be, e.g., what about quoted items inside URL. Maybe the best route is to just document that anything after the = up to the end of line, will just be accepted as the URL, and document it better. Any thoughts?.
I'll also try and test it with a "http" URL, but this'll be a little more difficult for me to set up - I mainly test in local mode.
2. As mentioned in my email to you, you've tripped over a case sensitivity bug in my code. The quick fix is to use lower case loop names, e.g., miraculousmandarin, but I'll also fix this in the next release (looking now to be sooner rather than later).
Hope this gets you back on track,
Rick
Hey Rick: OK, alllowercase
Hey Rick:
OK, alllowercase works just fine -- now I'll go back and try with HTTP URLs for the MP3s. Cool!
Handling "special" characters inside Flash is a bit murky to me -- trial and error have shown me what a lot of the characters are coming in via XML are automagically encoded.
I went for the "from the = to end of line" route with my plugins,and it seems to work OK; moreso for me because it's possible a user would want to use a quote mark or other special character in the URL (jaaaab, you listening?
).
Update: HTTP seems to work
Update: HTTP seems to work just fine, too, now that I'm using all lower case...
Hey Rick: OK, a little more
Hey Rick:
OK, a little more testing here... Now I seem to have difficulty running a custom function at the end of a mix... I'm testing both locally and via HTTP. Local testing is more reliably responsive.
Using something like the below:
playFirstAudio="external.ia_ambientmix.mix=firstmp3:0.7,1000,,playNextAudio"
playNextAudio="external.ia_ambientmix.mix=somemp3:0.7,1000,,playFirstAudio"
>
I expect the first audio to play, then call
playNextAudio; this then plays, then calls back on the first audio file. What happens though, is the first mix loops forever.I understand what I'm trying to do is sort of against the whole layered/mix thing, but in this case I don't want to layer the sounds -- and it seems from the documentation that I should be able to do this. Please point me to the right path.
[Testing locally, but loading MP3s via HTTP does sometimes result in the second MP3 loading up and playing -- but then it loops forever. This happened when (I'm guessing) the first MP3 was taking too long to load in, and the mix skipped ahead...]
I'm trying to use this
I'm trying to use this plugin but i can't figure out what am i doing wrong, because it doesn't work. I've already followed all the instructions.
Can you help me?
I don't know how to post correctly the xml file here.
Hi Romeu: Can you post a
Hi Romeu:
Can you post a link to your example?
To summarize, there are two
To summarize, there are two known issues with the current release:
1. Don't use mixed case in loop names; use lower case. Loop names are defined in the plugin parameters (the name preceeds the '=') and used in mix assignments (the loop name precceds the ':'). This will be fixed in an upcoming release.
2. Despite what the documentation says, don't quote the url's in the plugin parameters. Although the code will remove the actual quote marks, it turns out Flash XML parsing converts them to '"', which the current implementation doesn't handle properly. In future (unless I hear arguments to the contrary) anything after '=' and up to the end of line will be passed transparently to the URLRquest constructor in Flash. This means outer quote marks probably still won't work (bad URL syntax), but at least it won't be the plugin getting in the way.
If anybody has any other issues, please post the XML and I'll try to sort it out.
Rick
[post updated to reflect
[post updated to reflect proper use of quote marks]
- patrick