audiocontext

AudioContext.decodeAudioData(…) not working on iPhone but working everywhere else

我与影子孤独终老i 提交于 2019-12-24 08:08:10
问题 I have the following very basic code which is part of a more complex problem. My problem here is the function: context.decodeAudioData(arrayBuffer) is not working on iPhone (tried on Safari and Chrome ) nor Mac (Safari), but it works everywhere else ( Android and Windows 10 (all browsers). Even it works on Mac (Chrome). On Mac (Safari) I get the following error: Unhandled Promise Rejection: TypeError: Not enough arguments Here is the code: window.AudioContext = window.AudioContext || window

Trying to capture audio but navigator.mediaDevices.enumerateDevices() is NULL on Safari 12 even with microphone permissions granted

☆樱花仙子☆ 提交于 2019-12-24 00:23:49
问题 See related question: Navigator.mediaDevices.getUserMedia not working on iOS 12 Safari We are trying to capture audio from user input user MediaDevices.getUserMedia and Audio Context When the user clicks a button we check for available devices and then we capture their audio stream let enumDevicePromise = navigator.mediaDevices.enumerateDevices() .then(devices => devices.find(d => d.kind === "audioinput" && d.label !== "" && d.deviceId === "default")) .catch((error) => { // handle error });

How to release memory using Web Audio API?

本小妞迷上赌 提交于 2019-12-22 09:06:03
问题 var context = new window.AudioContext() var request = cc.loader.getXMLHttpRequest(); request.open("GET", 'res/raw-assets/resources/audio/bgm.mp3', true); request.responseType = "arraybuffer"; request.onload = function () { context["decodeAudioData"](request.response, function(buffer){ //success cc.log('success') window.buffer = buffer playBgm() }, function(){ //error }); }; request.onerror = function(){ //error }; request.send(); function playBgm(){ var audio = context["createBufferSource"]()

WaveSurfer JS can not generate graph in firefox for the specific mp3 audio file

∥☆過路亽.° 提交于 2019-12-13 03:35:07
问题 We are facing problem to draw the audio visualization (graph) by wavesurfer JS in Firefox for some specific format of the mp3 file. It always gives us the error like: The buffer passed to decodeAudioData contains an unknown content type. But same file is running in chrome without any problem. After the investigation, we have found that decodeAudioData() is used in wavesurfer JS which is generating the error while decoding audio file data contained in an ArrayBuffer. Since we don't have an

Android Chrome 39 getByteFrequencyData returns 0 array

我是研究僧i 提交于 2019-12-13 02:18:26
问题 I have setup example here - http://jsbin.com/hotovu/2/ On desktop chrome all is good. Android Chrome 39 returns all the arrays to 0,0,0, ... ( on ADB plugin for chrome debug ) Any workaround to make this work ? 回答1: This is a known bug. http://crbug.com/419446. It's not the Analyser, it's the media element. If you can load it with XHR into a buffer and play it, it will work. 来源: https://stackoverflow.com/questions/27552704/android-chrome-39-getbytefrequencydata-returns-0-array

Uncaught DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6)

北城余情 提交于 2019-12-12 06:07:02
问题 i am trying to implement microsoft bing speech api and its working fine for the first 5 times after that when i record my voice i getting exception in console . Exception : Uncaught DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6). when i try to close with AudioContext.close() it shows another error like "Uncaught (in promise) DOMException: Cannot close a context that is being closed or has already

Javascript - Seek audio to certain position when at exact position in audio track

ε祈祈猫儿з 提交于 2019-12-11 05:18:29
问题 Scenario: Audio starts playing from 0:00 . At exactly 0:05 , the track skips forwards to 0:30 . The track immediately starts playing at 0:30 , and at exactly 0:35 , the track skips backwards to 0:05 and plays the rest of the audio file Summary: Play: 0:00 to 0.05 , Skip: 0:05 to 0:30 , Play: 0:30 to 0:35 , Skip: 0:35 to 0:05 , Play: 0.05 to END The real problem comes when there is the need for a immediate and seamless skip. For example, setTimeout is very inaccurate and drifts meaning it

OfflineAudioContext and FFT in Safari

社会主义新天地 提交于 2019-12-10 18:28:01
问题 I am using OfflineAudioContext to do waveform analysis in the background. All works fine in Chrome, Firefox and Opera but in Safari I get a very dodgy behaviour. The waveform should be composed by many samples (329), but in Safari the samples are only ~38. window.AudioContext = window.AudioContext || window.webkitAudioContext; window.OfflineAudioContext = window.OfflineAudioContext || window.webkitOfflineAudioContext; const sharedAudioContext = new AudioContext(); const audioURL = 'https://s3

Web Audio API Stream: why isn't dataArray changing?

♀尐吖头ヾ 提交于 2019-12-10 12:08:20
问题 EDIT 2: solved. See answer below. EDIT 1: I changed my code a little, added a gain node, moved a function. I also found that IF I use the microphone, it will work. Still doesn't work with usb audio input. Any idea? This is my current code: window.AudioContext = window.AudioContext || window.webkitAudioContext; window.onload = function(){ var audioContext = new AudioContext(); var analyser = audioContext.createAnalyser(); var gainNode = audioContext.createGain(); navigator.mediaDevices

Extracting fragment of audio from a url and play it with pure Web Audio API

你说的曾经没有我的故事 提交于 2019-12-08 03:38:36
问题 On the following url: https://www.tophtml.com/snl/15.mp3 there is one audio I want to play using pure Web Audio API on the following range : range from: second: 306.6 range to: second: 311.8 total: 5.2 seconds I downloaded that file to my desktop (I'm using Windows 10 ), then opened it with VLC and got the following file info: number of channels: 2 sample rate: 44100 Hz bits per sample: 32 (float32) Here you have info about concepts on this: https://developer.mozilla.org/en-US/docs/Web/API