Questions tagged [audiobuffer]

92 questions
22
votes
5 answers

How to create an AudioBuffer from a Blob?

I have an audio file/blob that has been created using the MediaRecorder api: let recorder = new MediaRecorder(this.stream) let data = []; recorder.ondataavailable = event => data.push(event.data); and then later when the recording is finished: let…
Maxime Dupré
  • 5,319
  • 7
  • 38
  • 72
15
votes
2 answers

How to convert ArrayBuffer to AudioBuffer?

I am streaming an arrayBuffer to convert to an audioBuffer in order to be able to listen to it. I am receiving a stream via a websocket event retrieveAudioStream(){ this.socket.on('stream', (buffer) => { console.log('buffer', buffer) …
Stretch0
  • 8,362
  • 13
  • 71
  • 133
11
votes
2 answers

How to control the sound volume of (audio buffer) AudioContext()?

I have following AudioContext() sound object in JavaScript. Its volume is 100%. I want to play its volume in 10% (where volume = 0.1). How can I reduce its volume to 10%? const aCtx = new AudioContext(); let source =…
Rashid
  • 1,244
  • 3
  • 13
  • 29
8
votes
4 answers

Capturing volume levels with AVCaptureAudioDataOutputSampleBufferDelegate in swift

I'm trying to live volume levels using AVCaptureDevice etc it compiles and runs but the values just seem to be random and I keep getting overflow errors as well. EDIT: also is it normal for the RMS range to be 0 to about 20000? if let…
Thomas
  • 435
  • 6
  • 20
7
votes
3 answers

How to get float array of samples from audio file

I’m developing a UWP application ( for Windows 10) which works with audio data. It receives samples buffer at the start in the form of a float array of samples, which items are changing from -1f to 1f. Earlier I used NAudio.dll 1.8.0 that gives all…
D. Viktor
  • 111
  • 1
  • 7
6
votes
2 answers

merging / layering multiple ArrayBuffers into one AudioBuffer using Web Audio API

I need to layer looping .wav tracks that ultimately I will need to be able to turn on and off and keep in sync. First I load the tracks and stopped BufferLoader from turning the loaded arraybuffer into an AudioBuffer (hence the false) …
samrad
  • 132
  • 1
  • 7
6
votes
1 answer

Convert AudioBuffer to ArrayBuffer

I've been looking all over the internet for an answer to this question and I can't find any resources. Does anyone know how to use JavaScript to convert and AudioBuffer object to an ArrayBuffer? This is my current attempt //Send audio data to…
random
  • 125
  • 1
  • 7
5
votes
1 answer

Play AudioBuffer in existing HTML5 audio tag

I've created a website that contains an audio-tag as well as a working drop-area for file upload.
A dragged…
idleberg
  • 12,634
  • 7
  • 43
  • 70
5
votes
1 answer

How to convert AudioBuffer to wav file?

I'm trying to convert an AudioBuffer into a wav file that I can download. I tried 2 methods: The first one, I record all the sounds going threw a mediaRecorder and do this: App.model.mediaRecorder.ondataavailable = function(evt) { // push each…
5
votes
2 answers

How to write audio file locally recorded from microphone using AudioBuffer in iPhone?

I am new to Audio framework, anyone help me to write the audio file which is playing by capturing from microphone? below is the code to play mic input through iphone speaker, now i would like to save the audio in iphone for future use. i found the…
Bala
  • 1,215
  • 3
  • 15
  • 30
4
votes
1 answer

How to create Blob from local file with require in NodeJS?

need help again I use Webpack and I have audio file, this is how I load it: const file = require('@/assets/filename.mp3') const blob = new Blob(file) // it doesn't work Now I need to get Blob from it.. I can't understand how to do that. And the…
MAZ
  • 643
  • 5
  • 18
4
votes
1 answer

JavaScript converting audio byte array to wav file or valid AudioBuffer

I have access to a byte array file (float32, big endian) from a URL, and I'm trying to convert it into something processable by WaveSurfer, which needs a valid ArrayBuffer, AudioBuffer, or a URL to a wav file. The closest I've gotten is using fetch…
thedavl
  • 183
  • 1
  • 9
4
votes
0 answers

How to release memory using Web Audio API?

var context = new window.AudioContext() var request = cc.loader.getXMLHttpRequest(); request.open("GET", 'res/raw-assets/resources/audio/bgm.mp3', true); request.responseType = "arraybuffer"; request.onload = function () { …
Billyrun
  • 41
  • 2
4
votes
2 answers

Web Audio API - Cloning an audioBuffer

I have a deepClone function that I use throughout my program that clones all the properties and values of one object and returns the cloned object (see code below). I am now wanting to include an audioBuffer in the object and successfully copy it to…
Alistair Hughes
  • 387
  • 2
  • 3
  • 13
4
votes
1 answer

Why is it more suitable to use a MediaElementAudioSourceNode for longer sounds?

Complete question: Why is it more suitable to use a MediaElementAudioSourceNode rather than an AudioBuffer for longer sounds? From MDN: Objects of these types are designed to hold small audio snippets, typically less than 45 s. For longer sounds,…
Maxime Dupré
  • 5,319
  • 7
  • 38
  • 72
1
2 3 4 5 6 7