html5-audio

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

情到浓时终转凉″ 提交于 2019-12-03 01:29:27
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, but the following warning is shown in the console: [Deprecation] URL.createObjectURL with media streams

How can I force an HTML5 audio element to buffer an entire song?

余生颓废 提交于 2019-12-02 19:24:34
I'm developing a local server that will stream a user's audio files so they can access them via web browsers using the HTML5 audio object. Since these files are on the user's computer, I expect the files to be buffered completely when they are loaded, but for certain large files, the songs get buffered part of the way, then stop, and resume buffering some time later. My question is: how can I force the audio object to buffer the entire song at once? Can I do this from javascript, do I have to set an attribute on the audio object, or is there anything else I can do? The solution I found was

Why can't I play sounds more than once using HTML5 audio tag?

落爺英雄遲暮 提交于 2019-12-02 19:00:34
This is how the sound is "stored": <audio id = "hammer" src="res/sounds/Building/hammer.wav"></audio> In the actual game (which I use sounds for), I use this to play the sound: function playSound(soundid) { document.getElementById(soundid).currentTime = 0; document.getElementById(soundid).play(); } But the sound plays only the first time, and never again! I tried resetting the "currentTime" in the console to 0, but I literally get this: >document.getElementById("hammer").currentTime = 0 0 >document.getElementById("hammer").currentTime 0.340... Why is this happening, how do I fix it? See this

HTML5 Audio: How to Play only a Selected Portion of an Audio File (audio sprite)?

别等时光非礼了梦想. 提交于 2019-12-02 18:28:18
I'm working on an iOS metronome web app. Since mobile safari can only play one sound at a time , I'm attempting to create an 'audio sprite' - where I can use different segments of a single audio track to generate different sounds. I have a 1 second clip with 2 half-second sounds on it. <audio id="sample" src="sounds.mp3"></audio> <a href="javascript:play1();">Play1</a> <a href="javascript:play2();">Play2</a> <a href="javascript:pauseAudio();">Pause</a> <script> var audio = document.getElementById('click'); function play1(){ audio.currentTime = 0; audio.play(); // This is the problem area audio

Waveform visualization in JavaScript from audio [duplicate]

梦想的初衷 提交于 2019-12-02 18:27:50
This question already has an answer here: How to write a web-based music visualizer? 4 answers I'm trying to use JavaScript to display the waveform for and audio file, but I don't even know how to get started. I found the Audio Data API , but am unfamiliar with most audio terms and don't really know what is provided or how to manipulate it. I found examples of waveforms in JavaScript, but they are too complicated/I can't comprehend what is going on. Then my question is: how can you use JavaScript to create a waveform of a song on canvas, and what exactly is the process behind it? Here's some

Get audio from an html5 video

旧城冷巷雨未停 提交于 2019-12-02 17:46:54
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. 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> </body> <script> var video = document.createElement("video"); video.setAttribute("src", "ourMovie.mov");

HTML5 audio not playing multiple times in Android 4.0.4 device Native Browser

隐身守侯 提交于 2019-12-02 15:55:33
I am currently working on an HTML5 project. There is an issue on playing same audio file multiple times in the same page in Android native browser . The issue is specifically noticed on Android ICS 4.0.4 version. In this version the audio will be played once , but when initiated again audio will not be played . The same thing is working perfectly in Android ICS 4.0.3 Version and on the newer 4.1.1 version. Tested Devices: Samsung Galaxy Tab (Android 4.0.4) : Playing first time only then it doesn't play HTC One (Android 4.0.4) : Playing first time only then it doesn't play Sony Tab (Android 4.0

Web Audio API for live streaming?

两盒软妹~` 提交于 2019-12-02 15:07:28
We need to streaming live audio (from a medical device) to web browsers with no more than 3-5s of end-to-end delay (assume 200mS or less network latency). Today we use a browser plugin (NPAPI) for decoding , filtering (high, low, band), and playback of the audio stream (delivered via Web Sockets). We want to replace the plugin. I was looking at various Web Audio API demos and the most of our required functionality (playback, gain control, filtering) appears to be available in Web Audio API . However, it is not clear to me if Web Audio API can be used for streamed sources as most of the Web

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

狂风中的少年 提交于 2019-12-02 14:54:02
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? AshleysBrain 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 lengths to try and make it bulletproof in Construct 2. Here's an outline of what I've done: Use the

htl5 voice recording with isualization [closed]

徘徊边缘 提交于 2019-12-02 14:30:42
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm building a HTML5 software that records a voice and when playing that voice a visualizer should be in action. Here is my code: // variables var leftchannel = []; var rightchannel = []; var recorder = null; var recording = false; var recordingLength = 0; var volume = null; var audioInput = null; var sampleRate