html5-audio

Firefox: navigator.getUserMedia is not a function

给你一囗甜甜゛ 提交于 2019-12-08 23:42:11
问题 I'm playing with browser and audio. I'm doing this var session = { audio: true, video: false }; var recordRTC = null; navigator.getUserMedia(session, initializeRecorder, onError); But, using latest FF available I got a javascript error, saying that navigator.getUserMedia is not a function I copied this code from this blog post: https://blog.groupbuddies.com/posts/39-tutorial-html-audio-capture-streaming-to-nodejs-no-browser-extensions And similar on latest Chrome: Uncaught TypeError:

How can I avoid this 'clicking' sound when I stop playing a sound?

一个人想着一个人 提交于 2019-12-08 23:15:01
问题 I really hope this question stays a programming question and do not end up an Sound Mechanics question... Here goes... I am doing some experiments in order to figure out how the Web Audio API works. What I am trying to do is a simple "Hang up phone" sound playing in a loop. The problem is that when the sound ends, you can hear a quite annoying 'clicking' sound. I cannot explain it better, but you can hear it if you test the code. Is there some way I could avoid this? Some filter I could apply

HTML5 Audio gets louder after pausing then playing again

此生再无相见时 提交于 2019-12-08 19:51:39
I'm making an audio player with JavaScript, everything works fine until I add a sound visualizer. When I pause the song and then play it again, the sound gets more louder every time I do it, until it gets distorsionated. I'm newbie with the HTML5 Audio API, I've tried to set the volume as a fixed value, but not works. The code of the visualizer it's: function visualizer(audio) { let context = new AudioContext(); const gainNode = context.createGain(); gainNode.gain.value = 1; // setting it to 100% gainNode.connect(context.destination); let src = context.createMediaElementSource(audio); let

How to cancel getUserMedia indicator after recording

岁酱吖の 提交于 2019-12-08 16:37:21
问题 I'm using the recorder.js and getUserMedia to do some audio recording in the browser. When starting the recording, the user is given the "Allow this site to use your microphone" prompt, and once they click allow, Chrome adds an indicator onto the tab's favicon to show that it is recording: Recording indicator http://ubuntuone.com/1nBkbmc9vA313WeWtV03Kz My issue is that the indicator never goes away, even after my application has stopped recording. Basically, I'd like to revoke my own

Extracting audio data every t seconds

我的未来我决定 提交于 2019-12-08 13:04:34
问题 I am trying to extract amplitude information from a sound loaded from a URL using the Web Audio API instantaneously (not in real time), which will likely require the OfflineAudioContext . I am expecting to obtain something along the lines of an array containing the amplitude of the sound every t seconds for the duration of the sound (with size depending on the duration of the sound, divided by t ). Unfortunately, documentation is sparse at this point, and I'm unsure of how to proceed. How can

Using Web Audio API to assign two sounds to two Divs and play each independently via a click event with javascript

放肆的年华 提交于 2019-12-08 12:33:24
问题 I have been picking away at the code linked in the url below and I haven't been able to get anywhere. I have only managed to reassign the event handler to a small div instead of the whole page. I can't figure out how to tweak this to load more than one sound. http://www.f1lt3r.com/w3caudio/web-audio-api/basic-examples/low-latency-playback-user-input.html With the code example below I haven't been able to trigger a sound via a click of a div at all. However this code seems nicer to look at so

How to play audio using JSON data from API call? (Spreaker)

早过忘川 提交于 2019-12-08 11:40:36
问题 I'm trying to play an audio file from this json data. https://api.spreaker.com/v2/episodes/5816235 "episode":{ "episode_id":5816235, "type":"LIVE", "title":"SPR", "duration":null, "show_id":1341125, "author_id":7883468, "site_url":"https:\/\/www.spreaker.com\/episode\/5816235", } Specifically, I'd like to scope into the episode_id, to play the live stream. As I am new to using API calls, what's the best way to use the data to play the audio? Is there a way to access it using Javascript?

condition and loop: how can i don't resume the music when calling the function several times?

一曲冷凌霜 提交于 2019-12-08 10:34:14
问题 i have this function to play music with web audio API: function playMusic(){ if(countPre<count ){ audio0.play(); audio0.src = '0.mp3'; audio0.controls = true; audio0.autoplay = true; audio0.loop = true; source = context.createBufferSource(); source.connect(analyser); analyser.connect(context.destination); } else{audio0.pause();} } However, the value of count and countPre are generated in a loop that runs 10 times per second. I have to put the function playMusic inside that loop in order to

Unable to seek audio file in chrome served by my own server

ε祈祈猫儿з 提交于 2019-12-08 08:42:29
I am trying to make a file server in Java which can serve seekable audio files. But my served files are not seekable in Google Chrome html5 audio player. When I seek forward it does nothing (even on downloaded content), if seek too much backward it starts from beginning. If I load the file from different location ( http://www.vorbis.com/music/Epoq-Lepidoptera.ogg ) then it is seekable. Here is my server code package com.company; import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer;

HTML5 Audio — analyzing output?

淺唱寂寞╮ 提交于 2019-12-08 07:12:29
问题 Is there a way to directly analyze the output of the content of an audio tag, and use the output? To be more clear, what I want to do is use the sound levels of the audio content to make a ball bounce higher or lower (using html5 canvas) depending on the level of the sound. For example, it would be really handy if there was something like audioElement.getVolumeLevel(), although I don't know if such a thing exists. Also, this question is specifically about using the audio element. I am aware