Questions tagged [audiocontext]

AudioContext is a modular interface for audio processing for the WebAudio API.

277 questions
34
votes
7 answers

Change sample rate of AudioContext (getUserMedia)

Im trying to record a 48000Hz recording via getUserMedia. But without luck. The returned audio MediaStream returns 44100Hz. How can i set this to 48000Hz? Here are snippets of my code: var startUsermedia = this.startUsermedia; …
f.lorenzo
  • 1,146
  • 2
  • 11
  • 24
28
votes
4 answers

Google Chrome Javascript issue in getting user audio - The AudioContext was not allowed to start

I have this Javascript code which I am using to capture audio input from user when they click on a microphone button. This code works in Mozila Firefox but when I am using it in Google Chrome it does not work and shows this warning/error in console…
user2966197
  • 2,793
  • 10
  • 45
  • 77
21
votes
3 answers

How can I extract the preceding audio (from microphone) as a buffer when silence is detected (JS)?

I'm using the Google Cloud API for Speech-to-text, with a NodeJS back-end. The app needs to be able to listen for voice commands, and transmit them to the back-end as a buffer. For this, I need to send the buffer of the preceding audio when silence…
azhar
  • 1,709
  • 1
  • 19
  • 41
17
votes
3 answers

How to play wav audio byte array via javascript/html5?

I'm using the following method to play a byte array containing wav data. The function is being called from a GWT project. This function plays back sound, but it sounds like some kind of Hellish monster. The sample rate is definitely correct (the…
breakspirit
  • 635
  • 1
  • 5
  • 10
14
votes
1 answer

Determining Frequencies in JS AudioContext.analyserNode

BACKGROUND My goal is to create a JavaScript-based web app to analyse and display frequency information in audio sources, both in-page sources (
Brian Peacock
  • 1,801
  • 16
  • 24
12
votes
2 answers

AudioContext how to play the notes in a sequence

I have followed this tutorial and come up with that code: context = new AudioContext(); play(frequency) { const o = this.context.createOscillator(); const g = this.context.createGain(); o.connect(g); …
Sergino
  • 10,128
  • 30
  • 98
  • 159
11
votes
4 answers

AudioContext issue on Safari

I'm trying to use AudioContext in my typescript file for an Angular 5 app. It works great on Chrome, doesn't work on Safari. Everything I see by googling says to use window.webkitAudioContext but that immediately blows up when the typescript…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
11
votes
2 answers

javascript readAsArrayBuffer returns empty Array Buffer

I am trying to read a local file using the FileReader readAsArrayBuffer property. The read is success and in the "onload" callback, I see the Array Buffer object in reader.result. But the Array Buffer is just empty. The length is set, but not the…
Anand N
  • 380
  • 1
  • 4
  • 12
8
votes
1 answer

Vertex Displacment with Audio Context (THREE.JS R76)

I am trying to map vertices from the AudioContext api in Three.js. Now, I have successfully done this with planes(non shader) but am running into problems trying to apply it to a cylinder. Since the cylinder vertices are full vectors, instead of 0's…
Michael Paccione
  • 2,467
  • 6
  • 39
  • 74
8
votes
1 answer

How do I get audio data from microphone using AudioContext HTML5

I'm trying to get a stream of data from my microphone (ex. volume, pitch). For now, I've been using getUserMedia to access my microphone audio. But I couldn't find a way to extract the data from it. My code : $(function () { var audioContext = new…
DennisL
  • 157
  • 1
  • 2
  • 7
7
votes
1 answer

How to avoid "HTMLMediaElement already connected previously to a different MediaElementSourceNode" in the AudioContext Interface?

I've made an audio visualizer in React with the AudioContext interface and I want the user able to enable and disable it. The visualizer works fine and I can disable it as well (I just remove the vis component) However, when I want to enable it…
BrocoLee
  • 71
  • 3
7
votes
1 answer

How can I request user permission for audio on Chrome?

I am working on SAAS solution and I need customers to receive notification sounds from the application. Even if they just launched it without any interaction with it. Google has changed Chrome behaviour regarding this aspect and now user is required…
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
7
votes
1 answer

Soundcloud Widget API gives Error only in Chrome: The AudioContext was not allowed to start

I had an simple Player on my Website where a Soundcloud Track can be played. I'm using the Widget API. Everything was working fine the last weeks, but now i get this Error in Chrome Browser (Desktop): The AudioContext was not allowed to start. It…
KainLaVey
  • 99
  • 5
7
votes
3 answers

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

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…
davidesp
  • 3,743
  • 10
  • 39
  • 77
7
votes
1 answer

Using AudioContext in multiple iframes

We have a blog, each post of which contains an iframe which in turn should play a sound using Web Audio when clicked Play. Problem is, after a certain number of posts is on the page, the next frame throws an error: Uncaught SyntaxError: Failed to…
mcm69
  • 670
  • 6
  • 14
1
2 3
18 19