html5-audio

htl5 voice recording with isualization [closed]

一笑奈何 提交于 2019-12-02 13:31:32
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 = 44100; var audioContext = null; var context = null; var outputString; if (!navigator.getUserMedia) navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; if (navigator.getUserMedia) { navigator

How to disable specific control in audio player HTML5

◇◆丶佛笑我妖孽 提交于 2019-12-02 13:01:12
问题 I just want to show the audio controls but prohibits the user to drag the button because I don't want the user to skip the song. How to make this work? 回答1: You can't. You either show the browser's builtin controls, or you don't. So what you should so is hide them and make your own (it should be easy if you don't want the seek functionality) or look at something like jPlayer (http://jplayer.org/) and hide the seek bar with CSS. 回答2: It seems there's currently (August 2015) still no standard

backbone.js bind to audio events

南楼画角 提交于 2019-12-02 07:43:45
How to do it? I searched SO, find one similar result, but it doesn't work. Here's my code: var Player = Backbone.Model.extend({ defaults: { //some variables }, //creating audio element setAudio: function(ogglink, mp3link){ //code, that works } }); var Playlist = Backbone.Collection.extend({ model: Player }); var MyPlaylist = new Playlist([ //some songs here ]); var OneSongView = Backbone.View.extend({ //added some 'template' and 'el' code initialize: function () { this.model.bind("change", this.render, this); }, render: function (eventName) { $(this.el).html(this.template(this.model.toJSON()))

Javascript audio loop

人盡茶涼 提交于 2019-12-02 07:39:44
I want to play an audio in background 3 times and after 3 times the audio will stop automaticlly. I've tried this code and it did not work. HTML CODE: <audio id='beep' controls> <source src="beep-02.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> JAVASCRIPT: var count = 1 document.getElementById('beep').addEventListener('ended', function(){ this.currentTime = 0; if(count <= 3){ this.play(); } count++; }, false); Thanks. You could try using onended: Reference: http://www.w3schools.com/tags/av_event_ended.asp or it could be you need to increment your count

Setting currentTime attribute programatically on audio element causes event listeners to fire indefinitely

纵然是瞬间 提交于 2019-12-02 07:32:04
As the title states, this behavior occurs when setting the currentTime attribute on an audio element programatically. When that value is set, the event listeners get fired over and over indefinitely. The audio will try to play, but since there is so much processing going on, the audio will skip and my browser will start to become unresponsive. I've solved the problem by removing the binding to the currentTime variable, but I am just asking if anyone has some insight as to why this is occurring? Initially, this was only happening on firefox, but today it started happening on chrome too. Does

How to disable specific control in audio player HTML5

限于喜欢 提交于 2019-12-02 07:07:31
I just want to show the audio controls but prohibits the user to drag the button because I don't want the user to skip the song. How to make this work? You can't. You either show the browser's builtin controls, or you don't. So what you should so is hide them and make your own (it should be easy if you don't want the seek functionality) or look at something like jPlayer ( http://jplayer.org/ ) and hide the seek bar with CSS. It seems there's currently (August 2015) still no standard way to hide specific controls in a clean way. The best way to handle this is by using a library for this. E.g.

Web Audio API - multiple synchronized tracks - stopping previous track when new track starts

可紊 提交于 2019-12-02 05:07:46
问题 I'm trying to mimic the Web Audio API multitrack demo from the 'Mozilla Web Audio API for games' Web doc. https://developer.mozilla.org/en-US/docs/Games/Techniques/Audio_for_Web_Games#Web_Audio_API_for_games The only caveat I have is that I want the previous track to stop, once a new track is clicked (instead of playing layered on top of each other). An example would be, click drums, the drums start playing, then click guitar, the drums stop and the guitar starts right where the drums left

Loading an Audio buffer and play it using the audio tag

妖精的绣舞 提交于 2019-12-01 23:15:06
问题 I am trying to load an audio buffer from an URL, and then to play it. I got most of the code form this HTML5 Rocks Tutorial. var request = new XMLHttpRequest(); request.open('GET', $(this).attr('data-url'), true); request.responseType = 'arraybuffer'; request.onload = function() { console.log(request); context.decodeAudioData(request.response, function(buffer) { console.log(buffer); $('#play').click(function() { var source = context.createBufferSource(); source.connect(context.destination);

Web Audio API - multiple synchronized tracks - stopping previous track when new track starts

笑着哭i 提交于 2019-12-01 23:03:02
I'm trying to mimic the Web Audio API multitrack demo from the 'Mozilla Web Audio API for games' Web doc. https://developer.mozilla.org/en-US/docs/Games/Techniques/Audio_for_Web_Games#Web_Audio_API_for_games The only caveat I have is that I want the previous track to stop, once a new track is clicked (instead of playing layered on top of each other). An example would be, click drums, the drums start playing, then click guitar, the drums stop and the guitar starts right where the drums left off. Any ideas? Are there better tools/libraries for handling web audio? http://jsfiddle.net/c87z11jj/1/

Firefox ignoring response header content-range and playing only the sample sent

前提是你 提交于 2019-12-01 22:18:38
问题 I have built an audio stream for mp3 files, and each time client hits the audio it receives something like this: But what it does is just plays 1 minute sample instead of 120 minute What am I doing wrong here? 回答1: Not 100% sure because you didn't provide code or an example stream to test, but your handling of HTTP range requests is broken. In your example request, the client sends Range: bytes=0- , and your server responds with a 1MiB response: Content-Length: 1048576 (aka. 1 MiB) Content