Closed mreinstein closed 1 year ago
Hi @mreinstein ! I am not maintaining this module anymore. I am trying to pass it on to a new maintainer that would be interested in it. But thanks for reporting this, and have fun playing with it!!!
@sebpiq if you want - you can transfer node-web-audio-api to @audiojs - there are other mainteiners and related modules and we'd appreciate to do refreshing. Btw you are invited!)
I'm having the same issue, except I'm not playing my audio in a loop.
I've got a series of audio nodes 'buffered' in an array, where when one finishes, the next one plays. When the first node in the buffer finishes (or gets very close to finishing), I get this error.
I'll look into this more to try and find where exactly this is happening, but so far I've found it happens regardless of how many audio nodes get buffered.
@dfcreative I can confirm that the fix suggested by @mreinstein works.
Alternatively @mreinstein I found that if I provide AudioContext
with the sample rate (myAudioContext.sampleRate = whateverMySampleRateIs;
), it equally works fine.
I feel a change does need to happen in regards to this, because it seems to not match up with the web audio api: My audio played fine when using similar code in the browser, without me having to provide the sample rate to AudioContext
.
Either way, my audio is working now.
I have the same issue when I play some specific .mp3 audio, and I also wrote a npm package based on this and speaker. The error happened in the lib/AudioBuffer.js 31:23
. Excuse me, do you have any solution now?
Additional, the "specific .mp3 audio" all can be played but their tune will be lowered and this error will be thrown after the audio playing is ended.
I think that I have known the solution now. After call the AudioContext.decodeAudioData
, and get the target AudioBuffer, we can get the sampleRate of it and assign this value to the AudioContext instance. Thus, this error will not to be thrown.
I think that I have known the solution now. After call the
AudioContext.decodeAudioData
, and get the target AudioBuffer, we can get the sampleRate of it and assign this value to the AudioContext instance. Thus, this error will not to be thrown.
I hope that could help. @mreinstein
@sebpiq this module is freakin' amazing!
I think I may have stumbled onto a bug when looping an audio file. I load an mp3 file, and run it. It plays for a little while. When it's about to loop, I see this error:
when I modify line 54 of
build/AudioBufferSourceNode.js
from:to:
The error goes away. I'm not sure why though! Is this a bug, or something specific to my particular use case?