html5-audio

Custom 1-button player with HTML5 audio tag

时光怂恿深爱的人放手 提交于 2019-12-04 11:45:09
问题 Working with the <audio> tag in some web development I've been doing lately, and one thing I'm trying to do is use it to build a word list and provide a pronunciation sample next to each word on the list. Setting this up isn't hard at all, however this sort of application hardly requires the full set of controls; just a play button. The controls element of the <audio> tag doesn't seem to be that well documented at all, however; all I can find on it is "always put 'on' here, unless you want to

Creating Audio using Javascript in <audio>

人盡茶涼 提交于 2019-12-04 11:31:59
问题 I can't find anything through net searches, but is there any plans to make an API to generate audio chunks to be played in an HTML5 <audio> tag? EDIT: this is the example:: PSEUDOCODE:: var music = new Song([Array of hertz levels or notes]); var box = document.createElement('audio'); document.body.appendChild(box); box.src = music.convert(); box.play(); 回答1: In theory, you can actually do this now -- set the source attribute of an audio element to a data URI which you build on the fly in your

Play symbol (▶) squished in document.title

只愿长相守 提交于 2019-12-04 09:54:06
Adding to the question on Why does the HTML symbol for ▶ not work in document.title , when I add the play symbol to the document title using the properly escaped javascript hex value, the symbol seems squished: JavaScript: document.title = '\u25BA' + document.title; Inside Page (correct) Inside Title (not so correct) See this fiddle for a working model. I've added /show/light so the javascript can actually access the document title on the main page, but if you take off the extension, you can see the code as well. jsFiddle This appears to be happening on all major browsers (Chrome, Firefox, IE)

How can I play .3gp audio file in HTML

空扰寡人 提交于 2019-12-04 09:50:23
I am using simple HTML5 audio tag. For .mp3 file it is working fine. But I want to play .3gp file. <audio controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> </audio> Browsers support only limited audio formats. see http://caniuse.com/#search=audio 3GP files are not playable in all browsers. Convert 3GP files to MP3 files, for example using Audacity audio editor . You have to use video tag for video, because 3gp is a video extension. <source src="video.3gp" type='video/3gpp; codecs="mp4v.20.8, samr"'> </source> to learn more you can read this page on

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

时光总嘲笑我的痴心妄想 提交于 2019-12-04 09:46:47
问题 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

Deprecation of createObjectURL and replace with the new HTMLMediaElement.srcObject doesn't work for Webcam stream

扶醉桌前 提交于 2019-12-04 08:57:41
问题 I get the warning that a function will be deprecated in Chrome future release. It's this script: navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; if (navigator.getUserMedia) { navigator.getUserMedia({ video: true }, (stream) => { this.src = window.URL.createObjectURL(stream); this.stream = stream; }, (error) => { console.log(error); }); } That records webcam so I can save it,

AudioContext() doesn't exist on some phones?

我与影子孤独终老i 提交于 2019-12-04 07:45:58
I'm attempting to use AudioContext() in the latest version of Chrome (34.0.1847.114) on a Samsung Galaxy SII 4G, but for some reason AudioContext() does not exist, nor does webkitAudioContext. The exact same code functions perfectly fine on a Nexus 5 and an older phone like a Galaxy Nexus, but not the SII. Is HTML5 audio not supported on some devices? If not can anyone explain why or point me to some documentation about AudioContext support? Exact code I'm using: window.AudioContext = window.AudioContext || window.webkitAudioContext; context = new AudioContext(); Again, this works perfectly

Record Sounds from AudioContext (Web Audio API)

丶灬走出姿态 提交于 2019-12-04 06:52:25
Is there a way to record the audio data that's being sent to webkitAudioContext.destination ? The data that the nodes are sending there is being played by the browser, so there should be some way to store that data into a (.wav) file. Currently, there's not a native way to do that, but as Max said in the comment above, Recorderjs does essentially this (it doesn't chain onto the destination, but is a ScriptProcessorNode you can connect other nodes to, and have its input recorded. I built on Recorderjs to do a simple audio file recorder - https://github.com/cwilso/AudioRecorder . Sine to opus

Play one HTML audio element at a time

倾然丶 夕夏残阳落幕 提交于 2019-12-04 05:10:42
I have many audio elements on a single page and I want to play just one element at a time. That is if one audio element is playing and I click on play on another element, the previous audio element should pause. I found a jQuery code from another question to do this but that uses an image as play/pause controls. I'm using the inbuilt controls='controls' attribute for the audio element instead. Is it possible to use jQuery to control the play/pause feature for the audio element in my case? Here is my HTML code <div> <p class="song"><h3><strong>#1 Intro - The Oath</strong></h3><p> <audio class=

HTML5 validation error: Element source not allowed as a child element of audio in this context

我与影子孤独终老i 提交于 2019-12-04 04:36:38
问题 This is a snippet of code from my assignment. I've checked the w3 samples http://www.w3schools.com/html/html5_audio.asp and it is formatted correctly. Am I just going crazy because of these errors or did I miss something? I believe it's that the HTML5 source element doesn't like how the type is written in but how else would I do it? Please let me know if you guys see anything I'm just missing. <li>.ogg(HTML5 <code>audio</code> tag) <ul> <li style="list-style-type:none;"> <audio controls> `