Page 1 of 1

Long duration WAV player

Posted: Sun Apr 26, 2015 11:51 am
by MattMatic
As promised, I've uploaded a simple "longwave.py" to GitHub:
https://github.com/MattMatic/micropython-longwave/

It allows you to play much longer WAV files than memory can allow. I've tested it with 32kHz mono WAV files, happily playing many minutes of audio.
Just added simple restart mechanisms so I can hook in events (e.g. the accelerometer's tilt detection) to trigger audio events :)

Ideally I'd like this to work from a DAC or DMA callback, rather than a linked timer. Additionally, it would be excellent to be able to vary the rate of DMA playback without having to restart or work out where we've got to. With both those facilities you can link the accelerometer into speed of playback - for engine noises etc :P

To do:
* Add circular playback of the whole file
* Add additional status info to know how much has been played.

Please excuse any poor Python coding... am new to Python (but not coding!) So any recommended restructuring gratefully accepted! ;)
Matt

Re: Long duration WAV player

Posted: Sun Apr 26, 2015 4:12 pm
by pfalcon
MattMatic, this is 3rd or so your post I move around - please select sub-forums for your posts better. In particular "MicroPython Development" subforum is only for development of MicroPython interpreter and core libraries, nothing else. It's important to use right subforum, so people who look for information you post, could actually find it.

Otherwise, great project! (To be posted in "Projects" forum of course.)

Re: Long duration WAV player

Posted: Sun Apr 26, 2015 5:33 pm
by MattMatic
pfalcon: first post I knew of :-( Didn't seem related to "Projects" as just a library rather than a project per-se. Wasn't immediately obvious TBH.

Will think twice before posting.