-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improved performance #1
Conversation
a1ee283
to
ffe012e
Compare
I think this is a good improvement, we can do better, but we would need to change hound, as the slowness right now is from hound reading samples. As you can see, most of the time is spent on reading the samples, for encoding, its 50/50 between reading from hound and writing to the file, so I think its okay. But we can make this very fast by using a simple wav writer, and we can do optimization when reading/writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Amjad50 for this useful improvement
I'll check it |
Another interesting detail/cheat, we can do this extremely easily and make it insanely fast. the wav file stores the PCM samples directly as bytes, without any compression, so it means the file content are actually stored in bytes, and this is true, as u can see here. So we can add just a header for wav and just copy the whole file, which should be fast |
Wow, is that really possible!! How can we get the header? Is it the same in all files or does it change? |
Hound uses this library: https://docs.rs/wav/latest/wav/index.html this library allows u to write the header, so yeah, would be interesting to try. The header looks like it has basic info, like filesize, sample rate, format, etc.... |
Methods to improve performance
Trying to improve further