AudioContext is a modular interface for audio processing for the WebAudio API.
Questions tagged [audiocontext]
277 questions
4
votes
1 answer
Write a wav file in Node.js from an AudioBuffer
I am new in Node.js programming and I am trying to convert a m4a file to wav file.
I used audiobuffer-to-wav, and web-audio-api.
This is my code:
const fs = require('fs');
const toWav = require('audiobuffer-to-wav');
const AudioContext =…

fastworker399
- 423
- 9
- 26
4
votes
0 answers
How to release memory using Web Audio API?
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 () {
…

Billyrun
- 41
- 2
4
votes
1 answer
AudioContext timing issues when window gets minimized
I followed the instructions in this article and created a Javascript metronome. It makes use of the Web Audio API and has audioContext.currentTime at its core for precise timing.
My version, available at this plunker, is a very simplified version of…
user5902649
4
votes
1 answer
Using WebAudio API from NodeJs
I want to use WebAudio(AudioContext) in NodeJS. However NodeJS does not support WebAudio. There is an npm for web-audio-api but it is still in alpha stage and is incomplete.
So how can I use WebAudio(AudioContext) in NodeJS.
Can I instantiate a…

Aniket
- 4,926
- 12
- 41
- 54
4
votes
1 answer
How to avoid playing back the sound that is being recorded
I'm talking about feedback - when you make a simple javascript application that opens a stream from the user and reads the frequency analysis (or whatever is it) it thorws all received data back to the headphones in both Google Chrome and Opera.…

Tomáš Zato
- 50,171
- 52
- 268
- 778
3
votes
1 answer
How do I decode MP3 with js-mp3 and play in AudioContext?
Because of a bug in Safari 15 that sometimes causes AudioContext.decodeAudioData to fail (see Safari 15 fails to decode audio data that previous versions decoded without problems) for normal MP3 files I'm trying to do a workaround. The workaround is…

Einar Egilsson
- 3,438
- 9
- 36
- 47
3
votes
1 answer
Combine setSinkId with stereoPanner?
I'm writing an Electron app to deliver separate audio streams to 10 audio channels, using a Focusrite Scarlett 18i20 USB sound card. Windows 10 splits the outputs into the following stereo outputs:
Focusrite 1 + 2
Focusrite 3 + 4
Focusrite 5 +…

Lars
- 31
- 1
3
votes
0 answers
How can I change the audio device for a WebRTC publishing stream while running an AudioContext script processor?
For the purposes of this example, I am using the basic publish HTML/js code from an Ant Media Server application (see https://github.com/ant-media/StreamApp/blob/master/src/main/webapp/index.html). (Note - I'm actually using the enterprise edition…

Ben Holness
- 2,457
- 3
- 28
- 49
3
votes
2 answers
Failed to execute 'getUserMedia' on 'MediaDevices': At least one of audio and video must be requested
I'm using AudioContext, programatically, with Typescript.
Here's my code:
/**
* Checks for getUserMedia
*
* @params: none
* @returns: any
*/
public hasGetUserMedia(): any {
const mediaservices = !!(navigator.mediaDevices &&…

Peter The Angular Dude
- 1,112
- 5
- 26
- 53
3
votes
0 answers
How can I get the bit depth/sample rate of audio JS?
I need to get the Sample Rate of Audio file, loaded by standard input element.
I tried to use this function
function func(e) {
let reader = new FileReader();
reader.readAsArrayBuffer(e.files[0]);
reader.onload = function(event) {
…

Vera
- 51
- 1
- 6
3
votes
1 answer
Trying to capture audio but navigator.mediaDevices.enumerateDevices() is NULL on Safari 12 even with microphone permissions granted
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…

islalobo
- 617
- 2
- 8
- 22
3
votes
1 answer
Extracting fragment of audio from a url and play it with pure Web Audio API
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…

davidesp
- 3,743
- 10
- 39
- 77
3
votes
1 answer
OfflineAudioContext and FFT in Safari
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…

Nuthinking
- 1,211
- 2
- 13
- 32
3
votes
2 answers
How to load audio file into AudioContext like stream?
For example i want to load 100MB mp3 file into AudioContext, and i can do that with using XMLHttpRequest.
But with this solution i need to load all file and only then i can play it, because onprogress method don't return data.
xhr.onprogress =…

Николаев Сергей
- 127
- 2
- 9
3
votes
0 answers
AudioContext / MediaRecorder working on mobile browser but not in cordova
I'm working on a "launchpad" type app. I've got the app working on desktop and mobile browser, but for some reason I can't get it to work in cordova.
I've boiled the app down to it's simplest form in the code below. You can also find a working…

Adam
- 3,142
- 4
- 29
- 48