You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on my audio processing library, I discovered that every sound I imported (and created in snap) has the same constant sample rate, 96000, even though the sample rate was explicitly something else.
After doing some digging, I found that the AudioContext.decodeAudioData() function now converts all audio files to have a 96000 sample rate, resulting in weird inconsistencies.
Just to be clear, this is not necessarily an issue with snap, it's an issue with browsers changing how audio data is handled.
I don't currently know how to get the audio samples and the correct sample rate, but I feel like it might be good to ditch the AudioContext class, since it messes with audio data.
The text was updated successfully, but these errors were encountered:
yeah, I've been noticing this also. Here's a little trick I use / built into Snap: If you access the microphone sensing reporter, e.g. to get the volume, it will adjust the sampling rate to whatever your hardware / browser currently uses. Although it tends to "forget" this quickly, sometimes :(
It seems like my device sample rate is 96000, so it didn't change anything.
Since I am creating an audio processing library, I want to be able to work with different sample rates, not dependent on the device settings (specifically so I can compare snap to my audio processing library in python).
While working on my audio processing library, I discovered that every sound I imported (and created in snap) has the same constant sample rate, 96000, even though the sample rate was explicitly something else.
After doing some digging, I found that the
AudioContext.decodeAudioData()
function now converts all audio files to have a 96000 sample rate, resulting in weird inconsistencies.Just to be clear, this is not necessarily an issue with snap, it's an issue with browsers changing how audio data is handled.
I don't currently know how to get the audio samples and the correct sample rate, but I feel like it might be good to ditch the
AudioContext
class, since it messes with audio data.The text was updated successfully, but these errors were encountered: