html5-audio

Mobile browsers unable to load base64 data uri for an <audio> tag

陌路散爱 提交于 2019-12-03 04:10:53
I am trying to cache audio by serving it from the server as a base64 encoded text file. For example: <audio src="data:audio/mp3;base64,//MkxAA......."></audio> This approach works fine on desktop browsers such as Chrome, Firefox and IE10. However it does not work on mobile browsers. After debugging the web page on a mobile device the request is simply cancelled by the browser (tested on Chrome, Safari, Firefox and Stock Android Browser). Does anyone know why this is occurring? I would be happy to let this go if I could understand the reason behind it and make sure I am not missing something!

How to design customized audio player with HTML

被刻印的时光 ゝ 提交于 2019-12-03 03:42:14
I have a layout for an audio player that I'd like to use with the HTML audio player element. I was trying <audio></audio> , and it's giving me the default player: Is there any way to change the style of the player to use the layout that I want to use? You can whip up a very nice looking set of custom audio controls for the HTML5 audio player pretty quickly. Using (mostly) basic HTML and CSS, with some light Javascript event handling is all that's required. This solution a fully-functional custom audio player based on the design provided. The full code and example can be found in the jsFiddle:

Get live streaming audio from NodeJS server to clients

非 Y 不嫁゛ 提交于 2019-12-03 03:34:09
I need to have a real time live audio stream from 1 client to a server to multiple listener clients. Currently I have the recording from the client working and stream the audio through socket.io to the server. The server receives this data and must stream the audio (also through socket.io?) to the clients that want to listen to this stream. It must be as real time as possible (minimize delay). I'm using GetUserMedia to record the microphone (browser compatibility is not important here). I want the clients to use HTML5 audio tag to listen to the stream. The data received on the server are

HTML5 audio - currentTime attribute inaccurate?

半腔热情 提交于 2019-12-03 03:28:52
I'm playing around a bit with the HTML5 <audio> tag and I noticed some strange behaviour that has to do with the currentTime attribute. I wanted to have a local audio file played and let the timeupdate event detect when it finishes by comparing the currentTime attribute to the duration attribute. This actually works pretty fine if I let the song play from the beginning to the end - the end of the song is determined correctly. However, changing the currentTime manually (either directly through JavaScript or by using the browser-based audio controls) results in the API not giving back the

Get audio from an html5 video

我怕爱的太早我们不能终老 提交于 2019-12-03 03:18:19
问题 Is it possible to get the audio from an mp4 or webm video element in HTML5? I'm trying to use https://github.com/corbanbrook/dsp.js to calculate FFTs for audio, however, I only have the mp4 and webm videos. 回答1: Not sure if this answers your question but you can run the audio of the video through the Web Audio API node graph. The code below can be demonstrated by changing the gain and filter parameters. I only tested this on Chrome. <!DOCTYPE html> <meta charset="UTF-8"> <title></title> <body

audio tag not working in IE9

和自甴很熟 提交于 2019-12-03 03:13:31
I'm experimenting with the audio tag. The file below does work in Google Chrome, but not in IE9. I'm always getting "audio tag not supported". I also tried wav, flac, wma --> same result. I suspect there might some issue with the compaitibility mode, but I don't find where to change it. Can anyone help? Kind regards Georg <html> <head> </head> <body> <audio controls="controls" src="c:\concerto.mp3" > audio tag not supported. </audio> </body> </html> Add the HTML5 doctype to the page and it should trigger standards mode in IE9. You should also add a title element to make the document valid : <

HTML5 audio - play sound repeatedly on click, regardless if previous iteration has finished

风格不统一 提交于 2019-12-03 02:57:31
I'm building a game in which a wav file plays on click - in this case it's a gun sound "bang". The problem is if I rapid click, it won't play the sound once for each click - it's as if the clicks are ignored while the sound is playing, and once the sound is finished, it starts listening for clicks again. The delay seems to be about one second long, so you figure if someone clicks 4 or 5 times per second, I want 5 bangs, not 1. Here's my HTML: <audio id="gun_sound" preload> <source src="http://www.seancannon.com/_test/audio/gun_bang.wav" /> </audio> Here's my JS: $('#' + CANVAS_ID).bind(_click,

How did Scirra get HTML5 audio so perfect in Construct 2?

江枫思渺然 提交于 2019-12-03 02:55:33
问题 Check out this space shooter demo. The HTML5 audio is perfect on Chrome 18 and Firefox 10. There is no lag in playing sounds and each sample plays perfectly. The last time I tried to play sounds using HTML5 audio and JavaScript I couldn't get a sound to play more than once. What sorcery is Scirra doing to make this so perfect? 回答1: I'm the developer of Construct 2, so I hope I'm sufficiently qualified to answer your question :) HTML5 audio is indeed a mess, so I've gone to considerable

A good Text-to-Speech JavaScript library [closed]

五迷三道 提交于 2019-12-03 02:50:01
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I am looking for a good text to speech javascript library for my application. I looked around and saw Jtalk and speak.js. But I'm not

understanding getByteTimeDomainData and getByteFrequencyData in web audio

青春壹個敷衍的年華 提交于 2019-12-03 02:17:00
The documentation for both of these methods are both very generic wherever I look. I would like to know what exactly I'm looking at with the returned arrays I'm getting from each method. For getByteTimeDomainData, what time period is covered with each pass? I believe most oscopes cover a 32 millisecond span for each pass. Is that what is covered here as well? For the actual element values themselves, the range seems to be 0 - 255. Is this equivalent to -1 - +1 volts? For getByteFrequencyData the frequencies covered is based on the sampling rate, so each index is an actual frequency, but what