html5-audio

How to mute/unmute mic in webrtc

走远了吗. 提交于 2019-12-01 01:16:15
问题 I have read from here that how i can mute/unmute mic for a localstream in webrtc:WebRTC Tips & Tricks When i start my localstream mic is enable at that time by default so when i set audioTracks[0].enabled=false it muted a mic in my local stream but when i set it back true it enable to unmute. Here is my code mute/unmute for a localstream: getLocalStream(function (stream,enable) { if (stream) { for (var i = 0; i < stream.getTracks().length; i++) { var track = stream.getAudioTracks()[0]; if

Capture Audio Input with flash or html5

笑着哭i 提交于 2019-12-01 00:44:47
I am trying to capture the microphone and send the recording to my server.. I tried this method here but it records only a big WAV and the upload can be slow sometimes. Is there a way to capture the voice and compress it on the client side? Best method would be to send the recording while recording, but I have no Idea if this is possible. (It works for YouTube Live Webcam recording, it must work for Audio only too..) Stefan Hey check out this post where i replied to a guy with a similar question as you. How do I embed a Flash audio recorder in my site i dont know about client side compressing

How to retrieve a MediaStream from a Blob url?

微笑、不失礼 提交于 2019-12-01 00:34:58
问题 It was possible to get an URL using window.URL.createObjectURL() from a stream like in below code. navigator.getUserMedia({ video: true, audio: true }, function (localMediaStream) { var video = document.querySelector('video'); video.src = window.URL.createObjectURL(localMediaStream); video.onloadedmetadata = function (e) { // Do something with the video here. }; }, function (err) { console.log("The following error occured: " + err); } ); Problem is now I have a blob URL like: blob:http%3A/

Changing <source> with HTML5 Audio works in Chrome but not Safari

試著忘記壹切 提交于 2019-12-01 00:33:38
I'm trying to make an HTML5 audio playlist that will work in each major browser: Chrome,Safari, Firefox, IE9+. However, I can't figure out how to change the sources in a cross browser compatible way. UPDATED For example, changing the <source> tag's src s works in Chrome but not Safari. While @eivers88's solution below using canPlayType works it seems easier to me just to change the <source> tag's src s. Can anyone explain to me why my code directly below works in Chrome but not Safari? JS: var audioPlayer=document.getElementById('audioPlayer'); var mp4Source=$('source#mp4'); var oggSource=$(

html5 audio. How to get bitrate

你说的曾经没有我的故事 提交于 2019-11-30 21:52:59
I'm writing an extension for google chrome. And I have a situation: I've got a link for mp3 file, and I could play it. I could extract duration of it.. But how could I calculate bitrate? Is it possible through some properties? Or through some calculations using file size? If second - how to get filesize? Thanks. Update: Do a HEAD request and get the filesize from the Content-Length header . Since you know the duration, you can then calculate the bitrate. Research: Here I want to share some of my research. You probably already know this -- the bitrate is stored inside according to the MP3

CSS style <audio>

◇◆丶佛笑我妖孽 提交于 2019-11-30 21:08:17
is there a way how to style timeline thumb (seeker) of an <audio> tag? I'm able to target and style most of the element using audio::-webkit- shadow DOM pseudo selectors. However, I was unlucky finding a selector to match the playback timeline thumb. It's done by <input type="range"> , another shadow DOM element. So basically I'm trying to target shadow DOM pseudo element inside another shadow DOM pseudo element. My playground is on https://jsfiddle.net/cLwwwyh5/ . I just need this to work in Chrome (Chrome App) Going through the list of available modifiers: audio::-webkit-media-controls-panel

Mobile Safari: Audio + cache manifest

大憨熊 提交于 2019-11-30 20:50:10
I'm having a small web app, which plays really short sound bits on the click of several buttons. It explicitly targets mobile Safari on iOS (iPad). After reading here and elsewhere about the several "shortcomings" of HTML5 audio in this context on mobile Safari and trying a few "hacks" and tricks, I'm stuck with a situation where Safari seems simply (for the lack of a better word) broken: I can play sound A (it takes a long time for it to start — I'm assuming it's downlading [again]?) on the click of button A. After that, clicking on button B will immediately play the sound A again. Same for

HTML5 - Get audio and video started together?

别来无恙 提交于 2019-11-30 20:46:09
问题 How would I go about getting audio and video started exactly at the same time using <audio> and <video> ? JavaScript is fine (and is probably needed). Thanks! 回答1: You didn't say anything about file types so I used HTML-5 formats that work in Safari. <!DOCTYPE> <meta charset="UTF-8"> <title> audio video</title> <audio id="audioInHTML" controls="controls"> <source src="audio.wav" type="audio/wav"/> </audio> </div> <video id="videoInHTML" width="320" height="240" controls="controls"> <source

Load audiodata into AudioBufferSourceNode from <audio/> element via createMediaElementSource?

拜拜、爱过 提交于 2019-11-30 18:31:49
Is it possible to have an audiofile loaded from <audio/> -element via createMediaElementSource and then load the audio data into a AudioBufferSourceNode ? Using the audio-element as a source (MediaElementSource) seems not to be an option, as I want to use Buffer methods like noteOn and noteGrain . Loading the audiofile directly to the buffer via XHR unfortunately isn't an option neither ( see Open stream_url of a Soundcloud Track via Client-Side XHR? ) Loading the buffer contents from the audio elements seems to be possible though: http://www.w3.org/2011/audio/wiki/Spec_Differences#Reading

html5 audio. How to get bitrate

时光总嘲笑我的痴心妄想 提交于 2019-11-30 18:02:18
问题 I'm writing an extension for google chrome. And I have a situation: I've got a link for mp3 file, and I could play it. I could extract duration of it.. But how could I calculate bitrate? Is it possible through some properties? Or through some calculations using file size? If second - how to get filesize? Thanks. 回答1: Update: Do a HEAD request and get the filesize from the Content-Length header. Since you know the duration, you can then calculate the bitrate. Research: Here I want to share