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.
2,376
questions
0
votes
0
answers
19
views
Decode partial audio using the Web Audio API?
Is there any way to decode partial (ie, streaming) audio data using the Web Audio API?
The only API call I see in the MDN Web Docs for decoding audio data specifies that it requires the full audio ...
-2
votes
0
answers
18
views
Realtime processing Audio JS
I wanna use my time stretch algorithm at real time processing.
How can I use my algorithm to process audio in js? (with ScriptProcessorNode or audioworklet)
Thanks.
-1
votes
0
answers
21
views
Is there a python or preferably a javascript (client) library to make "beats" AND render the beat to mp3/wav? [closed]
What i want:
I want to make tiny short songs (a beat) by inserting drum sounds in a kind of loop programmatically. After i made this beat programmatically i would like to render (save) the entire ...
0
votes
0
answers
19
views
Is there any way to track volume with the web audio api
I'd like to be able to track how loud the song gets in realtime, returning a number to represent the current volume of the song. The source is from a sample that plays when you click it. Ive seen ...
0
votes
0
answers
15
views
How to make oscillator loudness match the loudness of a sample?
I want a tone from an oscillator to play under an audio clip of a song. How do I make the tones loudness match the loudness of the sample? I want the tone to be quieter when the song is quieter, and ...
0
votes
0
answers
23
views
Check volume of audio in real time
I want to log the volume level of an audio file as its playing, to see if it hits a threshold. I tried using the .createAnalyzer function but can't figure it out.
I have the function "repeat"...
0
votes
0
answers
24
views
Visualization of audio(webaudio) not working in chrome
I want to visualize audio that is coming in from webrtc(JSSIP). I used WebAudio, connected analyzer node and it seems to be working fine with Firefox.
In chrome browser, thing seems to be not working. ...
0
votes
1
answer
16
views
What does HTMLMediaElement suspend event mean?
In MDN it says "The suspend event is fired when media data loading has been suspended." But what does this actually mean? What are some examples for this event. I'm especially interested in ...
0
votes
1
answer
27
views
Why is the actual value of this variable not being used as the index number of the object I'm trying to return
This has been driving me bonkers since Monday June 6 2022, I really hope someone can tell me what I am doing wrong.
I have a music machine written (as a hobby/learning experience) in JavaScript using ...
0
votes
2
answers
50
views
Web audio : when mobile screen turns off, setTimeout slows down
EDIT: per Yogi's comment (see "setTimeout" and "throttling" in https://developer.mozilla.org/en-US/docs/Web/API/setTimeout ), I've tried adding an AudioContext to prevent the ...
1
vote
2
answers
42
views
Audio - how to check if path is valid
I am trying to play an audio file:
path = '/public/recordings/weekday/1.mp3'
const audio = new Audio(path)
audio.play()
If the path is NOT valid then the following warning appears in the console:
...
0
votes
0
answers
24
views
Web Audio API only playing when code changes?
So I have this code to load in an audio file and play it:
export function Note(props) {
const [played, setPlayed] = useState(false);
const noteDiv = useRef();
const play = useRef();
const ...
0
votes
1
answer
39
views
Web Audio API not playing sound
So I have a piano website where you can draw in notes on a screen and press a button to start a playhead, and as the playhead moves along the screen, the notes under it get played. I'm using the ...
0
votes
0
answers
35
views
How to move the vertical line drawn on a line graph in d3.js according to the playback of audio
I have successfully drawn the audio volume on a line graph. (line 63)
I have also successfully drawn a vertical line on the line chart to indicate the position of the audio playback. (line 65)
The ...
0
votes
0
answers
14
views
Any way to incorporate surround sound into flutter app?
Is there any way of incorporating spatial sound into a flutter app(not web)? I have looked at the surround_sound package(https://pub.dev/packages/surround_sound/example) but it doesn't let you have ...
1
vote
0
answers
27
views
I am using Web Audio API with React, but DecodeAudioData is not taking an ArrayBuffer to play a file
This code works well in Vanilla JS, but when in a component of React audioContext.decodeAudioData(buffer) returns the error:
"Uncaught (in promise) DOMException: The buffer passed to ...
0
votes
0
answers
18
views
File data buffer does not contain the entire file?
I'm attempting to stream an mp3 file as response to a get request from the client. I got as far as receiving a buffer and making it play. However when I made the buffer play with the web audio API, I ...
0
votes
0
answers
37
views
AudioElement/WebAudio/WebSpeech and output latency
I tried three methods of playing back/generating audio on a Mac and on Android devices. The three methods are
loading a file into an AudioElement (via <audio>),
creating a sound with the ...
0
votes
0
answers
12
views
Synthesizer and .mp3 notes play twice on Android-nowhere else
https://icanplaypiano.com/
Does anyone know why-This code works fine on laptops, ipads, iphones but plays double (one repeat) notes on Android phone systems? I also have Google Analytics code (not ...
0
votes
0
answers
10
views
Tonejs. Create connectable object
I want to have an object that can be connected to, for example:
class MyThing{
whatILookFor(time, value){
// That would be called from the connected node
}
}
let myThing = new ...
0
votes
0
answers
15
views
Synchronizing WebAudio.currentTime and audio.currentTime
I want to synchronize audio.currentTime associated with audioContext.currentTime.
In the example below, if audio stops after 1.5 seconds, you can see that audioContext.currentTime continues to ...
-1
votes
0
answers
10
views
Im trying to visualize Audiofiles with the WebaudioAPI but getByteFrequencyData always is always 0
function playSound(){
let noise = context.createBufferSource()
noise.buffer = generateWhiteNoise()
const analyzer = context.createAnalyser()
analyzer.fftSize = 2048
let test = new Uint8Array(...
0
votes
0
answers
24
views
DOMException: Failed to load because no supported source was found in ReactJS
I am new in react.I am trying to create a music player using Axios, Rapid API. When I test with local mp3 file it works.But when I use the url from API, I get the error and no sound comes out every ...
0
votes
0
answers
39
views
Multiple JavaScript audio visualizers
This is my first post here as a noob in coding. I'm trying JavaScript tricks with audio visualizers with the tutorial of FrankLaboratory's YouTube channel as a starting point.
I tried to make several ...
0
votes
1
answer
38
views
Web Audio API: outputChannelCount not working when I inherit from AudioWorkletProcessor
I have the following example. I try to pass the options parameter via calling super(...). When I do this, I don't get 2 output channels as I specified, instead I only get 1 output channel.
class ...
0
votes
0
answers
19
views
Glitch audio using web audio api
Similar to the Pure Data example here (https://www.youtube.com/watch?v=FLK854QyjE4) I'm trying to conceptualise how a file, such as a text file, might be read in Javascript and played back as glitch ...
0
votes
0
answers
9
views
XSS safe online javascript worklets
I would like to create an online editor where people can script their own AudioWorkletProcessors in javascript which will then be run as worklets on the webpage for other users. Are worklet processors ...
0
votes
0
answers
14
views
Seamless audio file concatenator for a js project?
I am trying to join/concatenate multiple audio files in a JavaScript project, and have tried using libraries like Crunker & Howler, but when I join concatenate my audio files, there is a small ...
0
votes
0
answers
20
views
Applying effects to MediaStream in audio tag streaming Shoutcast
I've got a project I've been working on that broke due to an update in Chrome and I've tried everything I can think of to fix it, but I think my underlying implementation is the problem.
In my project,...
0
votes
0
answers
26
views
Change an audio file frequency into ultra-sonic sound frequency
I'm trying to change my audio file frequency in Javascript and after a lot of struggle I came to one solution, files are given below but I face one limitation here that it can only convert frequency ...
0
votes
0
answers
18
views
Am I approaching oscillators wrong with the Web Audio API? Trying to make an Mono synth in React
I'm creating a mono synthesizer using the Web Audio API and React. I've created an oscillator and have actions for when a key (in my current code, just a single button) is pressed and released. I get ...
0
votes
0
answers
29
views
Normalizing audio in javascript AND saving result to file
Ive been playing around with JS normalizer to bring widely different volume recordings to play at a fairly constant volume.
This code is doing it's job quite nicely.
My final goal though is to allow ...
0
votes
1
answer
43
views
Javascript - Web Audio API -- Range type Input is not dynamic in Firefox, but it is dynamic in Chrome -added reprex
The gain controller works dynamically on chrome, but in firefox it does not. I need to re-play audio file for browser to recognize new input value of the range input for firefox. I couldn't figure out ...
1
vote
1
answer
119
views
How to play audio file with vue.js
I'm trying to play an audio file in my vue.js project as such:
import sound from '../../recordings/sound.mp4'
const audio = new Audio(sound)
audio.play()
This works perfectly well, but import may ...
1
vote
0
answers
18
views
How do you turn an audio wave represented by values into a wavetable using Fast Fourier Transform?
I've scoured a lot of articles and links and questions here but I really can't get my head around FFT's. I'm simply trying to convert an array of values that represents a waveform, [0, 0.5, 1, 0.5, 0, ...
0
votes
0
answers
38
views
How can I get the volume from navigator.mediaDevices .getUserMedia?
I need to get the volume from the audio but I don't find any example to do this in angular.
.getUserMedia({ audio: true, video: false })
.then((stream) => {
this.micro = stream;
}...
-1
votes
1
answer
94
views
How to disable raw audio capture on chromium based browser?
Hi is there anyone who have solved the problem with raw audio capture in chromium based browser? My Laptop uses conexant audio driver which doesn't allow for raw audio capture in any chromium based ...
0
votes
0
answers
78
views
Clap detection using Javascript
I'm quite new to the question but I try something like this.
I know Audio api is powerfull but I'm not understand much, so I came with :
let asClap = false;
let tampon = 60;
navigator.mediaDevices....
0
votes
0
answers
23
views
Is it possible to specify a range for the volume from AudioWorkletProcessor?
I followed the W3C's Documentation to implement a "vumeter" (code) using JavaScript's Web Audio API specifically the AudioWorkletProcessor and AudioWorkletNode interfaces. I would like to ...
0
votes
1
answer
151
views
Next.js load audio from url for wavesurfer on the client side
I want to be able to listen to and render audio peaks using wavesurfer.js, but when I load the url from an external source, the waveform loads as a flat line. I tested using the same audio file by ...
-1
votes
1
answer
75
views
How to implement a logarithmic range slider for audio?
Humans don't perceive sound linearly. We perceive sound on a logarithmic scale like so:
Linear Scale 0 1 2 3 4 5 6 7 8 9 10 (+1)
Logarithmic Scale 1 2 4 8 16 32 ...
0
votes
0
answers
16
views
Why decodeAudioData for Icecast stream only works on Desktop Chrome browser
I have a livestream that is served through Icecast as an audio/mpeg. I use the following code to grab the audio from a livestream to listen to the audio:
function playLiveAudio() {
...
0
votes
1
answer
21
views
convert recording audio to buffer
I want to record audio in javascript and convert it to a buffer at the time (not saving it to a file and then converting it to a buffer).
how I can do this?
I tried to do this with Web Audio but I ...
0
votes
1
answer
66
views
Lag when playing mic audio directly to output using web audio api
I simply want to play audio coming in the microphone directly to the output, using the code below. But there is a lag, about 0.2 seconds. Is there a way to reduce this delay ?
navigator.getUserMedia = ...
1
vote
1
answer
77
views
Stream static video file through webrtc
what I am trying to accomplish is to have on my page audio and video file. And then send them through webrtc. I managed to do this with audio using web audio api like this.
HTML:
<audio id="...
0
votes
1
answer
44
views
How do I record musical notes as they are played with the Web Audio and Media Recorder api's?
I'm trying to create a little app that records sounds from audio nodes as they are played using the Web Audio API, but have run into a few problems.
I have two buttons ('start recording' & 'stop ...
1
vote
0
answers
46
views
Sequence musical event with Web Audio API
I would like to sequence musical events with web audio, to do a simple musical piece. I'm just gettin started with web audio & I'm looking for tips or pointers in the right direction to be able to ...
0
votes
1
answer
98
views
WEBRtc with WEB Audio Api
I want to get track from webrtc and then play it, but my realization don't work. (Track's state is "live" but i dont hear audio.)
How can I do it without HTMLAudioElement and new Audio
pc....
0
votes
1
answer
23
views
Isolate output of right channel or left channel of audio blob using a panner (Javascript)
I am using wavesurfer.js to display and play an audio blob and am looking for a way to isolate the audio output of the right channel and left channel. I tried adding a StereoPannerNode but it seems ...
0
votes
1
answer
39
views
Modify AudioBuffer volume in JavaScript
How can modify AudioBuffer volume in javascript ?
I just wanna modify AudioBuffer volume without play any sound and without use any gain.
Finally , I wanna to have a new AudioBuffer with modified ...