-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[shared-module/audioio/WaveFile.h] Change sample_rate from uint16_t t… #1926
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
Conversation
…o uint32_t so it matches the sample rate type parsed from the WAV header format, fix adafruit#1922
I checked other uses of sample_rate in other audio native classes, and they are uint32. The WAV file header itself uses 4 bytes for sample rate. So this looks safe and consistent. |
@dhalbert Hi, i was planning to check what is the maximum sample rate allowed for wav files. But as you say it seems its safe to merge. For reference:
From here. |
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.
Looks good to me! Thank you!
Thanks for quick fix. |
I was thinking about this a bit more. This can be picked up by the compiler but the warning isn't commonly enabled perhaps because of the traditional habits of the typical C programmer. gcc's
It might be worth running -Wconversion (cf |
…o uint32_t so it matches the sample rate type parsed from the WAV header format, fix #1922