Closed RossComputerGuy closed 5 years ago
@SpaceboyRoss01 simplest way for now is counting generated data - every time you generate a buffer, you require a number of samples, ie.
let n = 1024
let buf = oscillate(n);
count += n;
//if more than 6 days - abort
let sixDays = 44100*6*24*60*60
if (count > sixDays) oscillate(null)
but that doesn't play the sound to the speaker
Well that was not the question :) Just output the generated data to the speaker that's it. I'll try to come up with more elaborate example once https://github.com/audiojs/audio-speaker/pull/44 is released.
Not sure what is the issue here. Pls let me know if that is still actual.
I am wondering if there is a way to have a sound be generated for a specific amount of time. Example: I could have the program oscillate a sound for 5 minutes or 6 days. This is for a virtual machine that I'm building. My code: