简体   繁体   中英

Playing a sound file on website media player

Hey all, i'm new to web development so i'm really dumb when it comes to tools for working on it. I have .amr files recorded from my BB application that are sent and saved on a server. I want to be able to play these files via a webplayer on a website, I have a couple of questions regarding this:

1) Would it be sound to convert these files to something like mp3 o wav instead of trying to play using the amr format? The sound files are received by a java web service and saved as files on my hard drive with the URL saved on a MySQL database. So if a conversion method is suggested I would prefer it be in Java.

2) What player can I use and how, to play these files? Be it the amr files or converted files

3) How can I create a link that will point to said audio file so people can go to it and hear it? I know this differs a little from my original question line but I have to able to do it as well.

thanks in advance

1) MP3 or wav would be a good idea. You could use something like LAMEonJ (http://openinnowhere.sourceforge.net/lameonj/) for wav -> mp3. And with luck there's something similar for AMR.

2) Is the <audio> tag in HTML5 likely to be an option? The users could then play the file directly in the browser, and you could just render HTML on the website, rather than providing it through a webservice.

I think you are suggesting an applet on a web page, that connects to the server via a webservice, which would certainly be possible but a lot more work.

Otherwise, if you're just serving a music file, you're not going to be able to control what player is used on the client side, once they have your file they can do with it whatever they like.

The only down side of HTML5 is that they'll need a relatively recent browser.

3) If you're using <audio> then this is already taken care of.

If you google for the <audio> tag I think you'll find a lot of information,as well as strategies for providing alternative players to older browsers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM