Replies: 10 comments
-
There's not a specific api for this yet, pr is welcome. You can use |
Beta Was this translation helpful? Give feedback.
-
Oh you asked for bit width, not sample rate. There is no API for this, see https://stackoverflow.com/questions/70071519/how-to-get-sample-rate-bit-depth-and-number-of-channels-with-web-audio-api and w3c/webcodecs#24 WebAudio has been around for 10 years and I'm always amazed at how incomplete it is. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
The conversion formula I use is: amplitude = peak * Math.pow(2, bitsPerSample - 1 ) // bitsPerSample -1 because we have a plus or minus, it takes one bit |
Beta Was this translation helpful? Give feedback.
-
Do you think it is acceptable for us to extend the RIFF field and only add the metadata information to.wav for the time being, and separate the logic to provide more header structure information in the future? |
Beta Was this translation helpful? Give feedback.
-
Sounds good. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
It's probably easier to give feedback on a pull request. Wavesurfer.js does have performance issues with large files and as long as this change doesn't make things worse it should be ok. |
Beta Was this translation helpful? Give feedback.
-
Did this get submitted? |
Beta Was this translation helpful? Give feedback.
-
@thijstriemstra |
Beta Was this translation helpful? Give feedback.
-
@therewasaguy
How do I get sample values from a wave file?
Beta Was this translation helpful? Give feedback.
All reactions