Questions tagged [web-audio-api]

Web Audio API is an advanced audio processing API directly available inside browser that helps to create, manipulate and analyze audio data using JavaScript.

Web Audio API is a powerful model completely different from the HTML5 <audio> element that helps to synthesis audio using JavaScript in browser.

The API uses Modular Routing architecture to create simple or complex mixings and effects. It comes with a low-latency precise-timing model that enables to schedule events at specific times in the future which is very crucial for musical applications.

It also has integration points with <audio> and <video> elements.

Some of the powerful features provided by the API are:

  • Processing live audio input
  • Integration with WebRTC
  • Spatialized audio
  • Convolution engine to create effects in Concert, Cathedral, Tunnel etc.
  • Dynamics Compression
  • Real-time time-domain and frequency analysis
  • Filters and Oscillators

References:

Demos:

2531 questions
20
votes
2 answers

Can Web Speech API be used in conjunction with Web Audio API?

Is it possible to use the synthesised speech from Web Speech API as a SourceNode inside Web Audio API's audio context?
zya
  • 830
  • 11
  • 25
19
votes
2 answers

Is there a way to use the Web Audio API to sample audio faster than real-time?

I'm playing around with the Web Audio API & trying to find a way to import an mp3 (so therefore this is only in Chrome), and generate a waveform of it on a canvas. I can do this in real-time, but my goal is to do this faster than real-time. All the…
Quasipickle
  • 4,383
  • 1
  • 31
  • 53
19
votes
2 answers

How to set srcObject on audio element with React

I've been trying to set the src attribute of an audio tag in React, but the track never plays. playTrack(track) { const stream = new MediaStream() stream.addTrack(track) this.setState(() => ({ stream })) } render() { return ( …
Erik
  • 2,299
  • 4
  • 18
  • 23
19
votes
1 answer

HTML5 Web Audio - Slowed down audio playback cuts off early

I'm working on a web-based music sequencer/tracker, and I've noticed that in my sample playback routine, audio contexts seem to exist only for the duration of of a sample, and that the Web Audio API doesn't seem to adjust playback duration when I…
Jessica Kagan
  • 319
  • 1
  • 8
19
votes
2 answers

Web Audio API append/concatenate different AudioBuffers and play them as one song

I've been playing with the Web Audio API and I'm trying to load multiple parts of a song and append them to a new ArrayBuffer and then use that ArrayBuffer for playing all the parts as one song. In the following example I am using the same song data…
18
votes
2 answers

How to select destination output device using Web Audio Api

I have been using web audio api and have created a context, and populated a source buffer with data. It plays fine over the default output device, but i don't understand how to choose the destination. In an old w3 spec you were able to pass in the…
Rogue45
  • 371
  • 1
  • 3
  • 10
18
votes
3 answers

custom wave forms in web audio API

I'm working through this awesome article: https://jackschaedler.github.io/circles-sines-signals/dft_introduction.html I want to use the Web Audio API's PeriodicWave object to implement this demo: However, when I set a periodic wave with these…
Eliot Winder
  • 252
  • 2
  • 9
18
votes
2 answers

decodeAudioData returning a null error

I come here hoping that you lovely folks here on SO can help me out with a bit of a problem that I'm having. Specifically, every time I attempt to use the decodeAudioData method of a webkitAudioContext, it always triggers the error handler with a…
ozzmotik
  • 377
  • 1
  • 3
  • 12
17
votes
7 answers

AudioWorklet error: DOMException: The user aborted a request

I've successfully instantiated a simple AudioWorklet in React and wish to start a simple oscillator like in Google's example. In order to test run it, I am rendering a button whose onClick event calls the following: src/App.jsx: userGesture(){ …
spidercatnat
  • 439
  • 1
  • 5
  • 15
17
votes
1 answer

Is WebM for audio too, or just video?

I've seen mentions of WebM being used for audio, but reading the WebM Project site and googling convert mp3 to webm has led me to believe that WebM is just for video. I definitely see lots of WebM to mp3 conversion utilities, but not the reverse. I…
Brian FitzGerald
  • 3,041
  • 3
  • 28
  • 38
17
votes
1 answer

HTML5 Microphone capture stops after 5 seconds in Firefox

I'm capturing audio input from microphone with getUserMedia() function, works fine in chrome, but in firefox sound dies out after 5 seconds. If I send request for microphone again (without reloading the page) same thing happens. Here is the code (I…
Starwave
  • 2,352
  • 2
  • 23
  • 30
17
votes
3 answers

Creating a 10-Band Equalizer Using Web Audio API

I'm trying to wrap my head around using the Web Audio API to recreate something like Winamp's 10-band equalizer. (source: head-fi.org) From what I can gather, I have to create 10 Biquad Filters, set their type to 2 (for a Bandpass filter) and set…
idbehold
  • 16,833
  • 5
  • 47
  • 74
17
votes
9 answers

Web Audio API resume from pause

I often read that it's not possible to pause/resume audio files with the Web Audio API. But now I saw a example where they actually made it possible to pause and resume it. I tried to figure out what how they did it. I thought maybe source.looping =…
dan-lee
  • 14,365
  • 5
  • 52
  • 77
16
votes
2 answers

Why Web Audio API isn't supported in nodejs?

I understand Web Audio API is a client side feature but nodejs is based on V8 Chrome client side implementation of ECMAScript, which include Web Audio API. Why there is no complete support of Web Audio API in nodejs ? Is it because AudioContext is…
TGrif
  • 5,725
  • 9
  • 31
  • 52
16
votes
4 answers

HTML5 web audio - convert audio buffer into wav file

I have an audio buffer rendered using webkitOfflineAudioContext. Now, I wish to export it into a WAV file. How do I do it? I tried using recorder.js but couldn't figure out how to use it. Here's my code: http://jsfiddle.net/GBQV8/.
pramodtech
  • 6,300
  • 18
  • 72
  • 111