View Full Version : Need help playing sound on the client side
05-05-2010, 10:40 PM
1) Script Title: Need help playing sound on the client side
2) Script URL (on DD): http://www.dynamicdrive.com/forums/newthread.php?do=newthread&f=2
Thanks for the help
05-06-2010, 12:49 AM
The "Dynamic Drive scripts help" section is for EXISTING scripts hosted in the Dynamic Drive library. I've moved this to the "Looking for a script or service" section because it fits here better.
This is not at all an easy question.
You can use a plugin like a quicktime player or windows media player. This requires that the user have it installed AND that it actually exists/works for their browser/system. There is no fully compatible media plugin. For example, quicktime is probably the best but it doesn't work (due to lazy programming from apple, as far as I'm concerned) on windows 64bit processors-- the menu bar turns black and you can't see what you're doing. And all the rest are less compatible.
The ideal solution for this is to use Flash. It's a plugin, but a special one since it works in almost every browser (though: warning-- not on many mobile devices).
The big problem with flash though is that it must have mp3 audio and converting to mp3 dynamically is almost impossible (it's possible, but do anything you can to avoid going down that path-- it'll either be extremely expensive or very technically complex or both).
If you CAN get all of your files in mp3 then flash is wonderful and easy.
I don't know of any way that you can dynamically create a file and then play it back to the user. I'm working on this same problem and I've determined that the only (semi)sane way to do this is to use a flash media server and make things very complex.
Sorry I don't have more encouraging solutions for you.
You've found one of the big problems with web design: media [aside from images] is horribly supported in general.
One thing to consider is that if your goal is just to make this for some users, then you could target a browser such as Firefox or Internet Explorer (the two best choices-- they both have lots of sound options) and require your visitors to use it. This obviously only makes sense for a site that's not meant for the world to see, but rather for a local site or something for a special purpose. But if you can manage to restrict things like this, your job will be a lot easier.
Finally, if worst comes to worst, you can always just have the user download an audio clip and play it with the default player (which sometimes will even be a browser plugin for a player like quicktime or windows media player).
If you have a more specific direction you want to pursue ask and someone can probably give more advice.
Also search google for these various methods and you'll find lots of (confusing/mixed/vauge) information about the various options. You won't find a "good" option because there isn't one, but you may find one that works for your specific goals.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.