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
80
votes
8 answers

Generating sound on the fly with javascript/html5

Is it possible to generate a constant sound stream with javascript/html5? For example, to generate a perpetual sine wave, I would have a callback function, that would be called whenever the output buffer is about to become empty: function…
Johannes Hoff
  • 3,731
  • 5
  • 31
  • 37
62
votes
4 answers

Access microphone from a browser - Javascript

Is it possible to access the microphone (built-in or auxiliary) from a browser using client-side JavaScript? Ideally, it would store the recorded audio in the browser. Thanks!
chris_aych
  • 729
  • 1
  • 5
  • 8
53
votes
4 answers

Web Audio API for live streaming?

We need to streaming live audio (from a medical device) to web browsers with no more than 3-5s of end-to-end delay (assume 200mS or less network latency). Today we use a browser plugin (NPAPI) for decoding, filtering (high, low, band), and playback…
Tony
  • 1,986
  • 2
  • 25
  • 36
41
votes
12 answers

No sound on iOS 6 Web Audio API

I was really excited to see iOS 6 supports the Web Audio API, since we make HTML5 games. However, I cannot get iOS 6 to play any sound at all using the Web Audio API with examples that work fine in desktop Chrome. Here is a HTML5 game with touch…
AshleysBrain
  • 22,335
  • 15
  • 88
  • 124
40
votes
2 answers

MediaRecorder.stop() doesn't clear the recording icon in the tab

I start and stop a MediaRecorder stream. The red "recording" icon appears in the Chrome tab on start, but doesn't go away on stop. The icon looks like this: My code looks like this: const mediaRecorder = new MediaRecorder(stream); ... // Recording…
Rick Viscomi
  • 8,180
  • 4
  • 35
  • 50
39
votes
1 answer

What's wrong with this simple FM synth design?

I'm trying to implement some features of a Yamaha YM3812 sound chip (aka OPL2 http://en.wikipedia.org/wiki/YM3812) in JavaScript using Audiolet (a synthesis library, http://oampo.github.io/Audiolet/api.html) Audiolet allows you to build a…
36
votes
3 answers

What does the FFT data in the Web Audio API correspond to?

I've used the FFT data from the Analyser node using the getByteFrequencyData method in the Web Audio API to create a spectrum visualizer as shown below: In this instance I have 256 bins of data. What exactly do the numbers in this correspond to? Is…
RobotEyes
  • 4,929
  • 6
  • 42
  • 57
35
votes
2 answers

mediarecorder api playback through Web Audio api (not audio element)

I'm having an issue getting a captured blob from the mediaRecorder api to playback in Chrome (it works in Firefox). Not sure if it's a bug in Chrome. The error it reports: undefined:1 Uncaught (in promise) DOMException: Unable to decode audio…
Nigel Skeels
  • 359
  • 3
  • 5
33
votes
4 answers

(Web Audio API) Oscillator node error: cannot call start more than once

When I start my oscillator, stop it, and then start it again; I get the following error: Uncaught InvalidStateError: Failed to execute 'start' on 'OscillatorNode': cannot call start more than once. Obviously I could use gain to "stop" the audio but…
Jacksonkr
  • 31,583
  • 39
  • 180
  • 284
29
votes
3 answers

Web Audio API: How to play a stream of MP3 chunks

So I'm trying to use Web Audio API to decode & play MP3 file chunks streamed to the browser using Node.js & Socket.IO. Is my only option, in this context, to create a new AudioBufferSourceNode for each audio data chunk received or is it possible to…
Jonathan Byrne
  • 304
  • 1
  • 3
  • 7
29
votes
4 answers

Using local file for Web Audio API in Javascript

I'm trying to get sound working on my iPhone game using the Web Audio API. The problem is that this app is entirely client side. I want to store my mp3s in a local folder (and without being user input driven) so I can't use XMLHttpRequest to read…
user1904515
  • 489
  • 1
  • 4
  • 8
28
votes
5 answers

Web Audio to visualize and interact with waveforms

How do I write a JavaScript program to display a waveform from an audio file? I want to use Web Audio and Canvas. I tried this code: (new window.AudioContext).decodeAudioData(audioFile, function (data) { var channel = data.getChannelData(0); …
katspaugh
  • 17,449
  • 11
  • 66
  • 103
27
votes
3 answers

Changing Speed of Audio Using the Web Audio API Without Changing Pitch

Is it possible to change the tempo of audio (in the form of loaded MP3 files) without changing the pitch using the Web Audio API? I'm aware of the playbackRate property on the AudioBufferSourceNode, but that also changes pitch. I'm also aware of the…
JaredCubilla
  • 538
  • 1
  • 8
  • 24
27
votes
3 answers

How to get microphone input volume value with web audio api?

I am using the microphone input with web audio api and need to get the volume value. Right now I have already got the microphone to work: http://updates.html5rocks.com/2012/09/Live-Web-Audio-Input-Enabled Also, i know there's a method manipulating…
kikkpunk
  • 1,287
  • 5
  • 22
  • 34
27
votes
1 answer

What's the difference between web audio and html5 audio anyway?

I've just asked a question about audio, and people suggest that this is a question about html5-audio instead of web audio. So i wonder what's the difference?
kikkpunk
  • 1,287
  • 5
  • 22
  • 34
1
2 3
99 100