And the recent line of cool releases continues, today with version 1.0 of a WAV to VB Converter by DogP which will spice up future homebrews with speech samples! Here’s some release notes Pat posted on the Forum:
Okay… attached is v1.0 of wav2vb and the wavonvb sample. It’s pretty self explanatory, but basically just do wav2vb <wavfile>.wav <outfile>.h [-s] to get the data in a .h (-s auto-scales, which is necessary for quiet files, since there’s only 4 bits per sample). You should make sure the sample rate of your input file is reasonably low, as well as tightly cropping the audio file, to save ROM space.
The wav player (wavonvb) basically initializes the sound for speech, then calls a function that writes (and blocks) until the wav data is written. This could probably be done with an interrupt on a timer if you wanted speech without a blocking call. There’s a #define called SR_DIV, which defines the delay numerator to be divided by the sample rate of the wav file, but it’s not perfect, so it’ll likely need to be tweaked, depending on the sample rate (it only affects the delay in the loop, neglecting the time to actually execute the sound writing).
I’m sure there’s plenty of bugs, but it’s been working for me… but let me know if you have any problems, or feature requests for the next version. I’ll probably try to get more resolution for the next one, which should help the sound quality, but take up more ROM space.
No replies yet.