Close

Sound Issues Resolved

A project log for µGame

A handheld game console programmable with (Micro/Circuit)Python.

dehipudeʃhipu 12/05/2017 at 11:193 Comments

As usual, the problem was in software. Actually, not even that, it was in the data. Turns out the .wav files I used were at fault — they didn't start at a zero value (hence the clicks at the beginning) and they were truncated compared to what was specified in their headers (hence the buzzing at the end). Running the files through sox fixed both problems and gave me nice retro sound:

Yes, there is a bug with the missile not getting deleted halfway through the game.

Discussions

davedarko wrote 12/05/2017 at 13:55 point

that's so cool :) so you went from "only some bleeps" to wave files? Was that actually easier with python?

  Are you sure? yes | no

deʃhipu wrote 12/05/2017 at 14:00 point

yes, there is a built-in audioio module that reads and plays the wav file (or a buffer) in the background, while your code continues to execute, which is very convenient in such a game

  Are you sure? yes | no

deʃhipu wrote 12/05/2017 at 14:00 point

plus, I can easily generate the wav files with tools such as sfxr — which is why they were so broken, in fact

  Are you sure? yes | no