html5-audio

Why doesn't Firefox support the MP3 file format in <audio>

老子叫甜甜 提交于 2019-12-16 21:01:38
问题 Is there a particular reason why Firefox does not support playback of MP3 files in <audio> elements, only Ogg format? Is it a licensing issue? Are there any plans made for a possible future implementation? Is it possible to develop an addon to support MP3 playback in <audio> elements? 回答1: Licensing issues: HTML5 video and H.264 – what history tells us and why we’re standing with the web and Mozilla defends Firefox's HTML5 support for only Ogg Theora video (despite their titles, they both

Multiple Play/Pause button with audio tag

廉价感情. 提交于 2019-12-14 03:59:27
问题 Im having trouble with more than 1 play/pause button in a same code, i have a table where there is a button and then the song name on cell to the right. the button works perfectly, here is the code(got it from internet): <script language="javascript"> function play_pause() { var myAudio = document.getElementById("myAudio"); if (myAudio.paused) { myAudio.play(); } else { myAudio.pause(); } } </script> And the audio part <html> <table> <tr> <td> <audio preload="none" id="myAudio" src="music.mp3

how to pause all playing audios on a page

我的未来我决定 提交于 2019-12-14 02:17:40
问题 I've got a html5 player which works like this : Html : <div class="player row" data-dwplayer="true" data-mp3="example.mp3" data-loop="true"> Javascript : $("[data-dwplayer=true]").each(function(){ var player = $(this); var audio = new Audio(); /* data */ var source = player.data('mp3') ? player.data('mp3') : player.data('ogg'); var auto = player.data('autoplay') ? true : false; var loop = player.data('loop') ? true : false; /* set source */ audio.src = source; and the rest of code ... meaning

Get precise notes with riffwave.js

蓝咒 提交于 2019-12-14 01:13:39
问题 Does anyone know if its possible to get a precise note (C, C#, D, Eb, etc) from a javascript library like riffwave.js? The demo makes me think is possible but I'm not sure how to transpose the piano frequency for a given note into the data array required for the generated wave file. 回答1: Sure! You'd want to create some mapping function from key to frequency (could just be a dictionary). To synthesize a given frequency with riffwave.js, you would do something like this function simHertz(hz) {

Playing html5 audio in ajax response in iOS

蹲街弑〆低调 提交于 2019-12-13 18:18:34
问题 After a lot of googling and researching, I have found out that iOS blocks autoplaying of html5 audio and video. Audio and Video can only be played as a response to a click event. Now, I have another problem. I run a music website with a lot of user generated playlists. After clicking play, I make an ajax request to fetch the track URLs, and then load them and play them. iOS doesn't consider this as a synchronous click event to play music, so the music doesn't start playing on clicking the

Can I record the output of an <audio> without use of the microphone?

感情迁移 提交于 2019-12-13 16:16:37
问题 I have an <audio> element and I'm changing the speed, start/end bounds, and pitch. I want to see if it's possible to record the audio I hear in the browser. However I don't want to just record with the microphone because of the lower quality. I could do the same effects server-side but I'd rather not since I'd be basically duplicating the same functionality with two different technologies. In response to a flag vote since it's "unclear what I'm asking", I'll rephrase. I have an <audio>

Is playing sound in Javascript performance heavy?

末鹿安然 提交于 2019-12-13 15:44:17
问题 I'm making a simple game in Javascript, in which when an object collides with a wall, it plays a "thud" sound. That sound's loudness depends on the object's velocity (higher velocity => louder sound). The play function: playSound = function(id, vol) //ID of the sound in the sounds array, volume/loudness of the sound { if (vol) //sometimes, I just want to play the sound without worrying about volume sounds[id].volume = vol; else sounds[id].volume = 1; sounds[id].play(); } How I call it:

html5 audio - canplay event doesn't fire on Safari (Mac Desktop)

最后都变了- 提交于 2019-12-13 14:51:22
问题 I'm trying to play some audio through the html5 audio tag (using Buzz as a wrapper if that makes any difference). Because the audio is timed to start with another event, I've been listening for the canplay event. It works perfectly on Chrome and Firefox, but Safari doesn't trigger the canplay event. I've added event handlers for all the possible audio events available and as far as I can tell it only fires the loadstart and loadedmetadata event. When the loadedmetadata is triggered the audio

Seek bar in mp3 file not working

若如初见. 提交于 2019-12-13 07:27:37
问题 I have been trying to play the mp3 file in browser using default html5 player. http://ujyaaloonline.com/audios/programAudios/1a8fdf5d0433ed581bbcee74836b3305.mp3 Audio is playing but the seek bar is not working here. What might be the problem. Please help. 回答1: You need to support byte range requests on the machine from which you're serving the audio. See SoundManager2's Technical Notes on the subject. Byte Serving is automatically negotiated between client and server, and offers a number of

how to mix in audio to html5 video?

Deadly 提交于 2019-12-13 07:03:14
问题 I have a video element, for example <video controls> <source src="foo.ogg" type="video/ogg"> <source src="foo.mp4" type="video/mp4"> Your browser does not support the <code>video</code> element. </video> I need to mix in an audio file so that when the user starts the video, the audio file plays along with the video, and when the movie stops/rewinds the audio would do the same. I did not find any functionality in the HTML5 video/audio API's that would allow me to do that. Does anyone know if