Questions tagged [audiocontext]

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

237 questions
28
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
  • 886
  • 2
  • 9
  • 22
19
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,591
  • 1
  • 16
  • 36
15
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
  • 555
  • 1
  • 3
  • 10
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
  • 7,401
  • 10
  • 55
  • 99
11
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); …
sreginogemoh
  • 7,997
  • 18
  • 71
  • 125
10
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,571
  • 12
  • 22
9
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
  • 352
  • 1
  • 4
  • 11
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
  • 1,524
  • 1
  • 18
  • 49
7
votes
2 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,193
  • 7
  • 33
  • 62
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
  • 540
  • 4
  • 13
6
votes
0 answers

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
  • 69
  • 4
6
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
  • 137
  • 2
  • 6
5
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
  • 6,197
  • 19
  • 92
  • 176
5
votes
1 answer

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page

I'm using the jspsych.js module, and when using it, I look at the console and I'm getting this error: The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. and it takes me to this lines of…
javiera
  • 75
  • 1
  • 5
5
votes
1 answer

With wavesurfer.js, how can I create an AudioContext AFTER loading the waveform?

I have: this.wavesurfer = WaveSurfer.create({ container: "#wavesurfer-player", height: 60, barWidth: 2, barHeight: 1, // the height of the wave barGap: null, scrollParent: false }); …
Shamoon
  • 33,919
  • 63
  • 225
  • 452
1
2 3
15 16