Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removeSilence() function breaks on larger files. Making it stereo? #3

Open
Catsvilles opened this issue Mar 7, 2020 · 0 comments
Open

Comments

@Catsvilles
Copy link

Hi, I really enjoy the web audio experiments you made and was playing around some useful functions you wrote. And noticed a few problems/ possible improvements:
So, as it says in the title - removeSilence() function breaks when feeding it with larger AudioBuffer (also with bigger silence chunks). Well it doesn't technically break but I did a little investigation and found out that the code works up until here:
return signal.filter((v, i) => { const frameIndex = Math.floor(i / numSamplesInFrame); return !longGroups.some(group => group.includes(frameIndex)); });
then it just continues working but making the CPU go above 100% for a way too long time. I believe it could be improved but my skills are limited here. How could I go around this?

Also, how can I make it return stereo buffer, I mean I could technically just fill the second channel with same audio data but would it be the right approach to do like this? Considering I don't want to loose the quality.

Thanks a lot! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant