Long duration WAV player

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
Post Reply
MattMatic
Posts: 13
Joined: Wed Apr 22, 2015 1:44 pm

Long duration WAV player

Post by MattMatic » Sun Apr 26, 2015 11:51 am

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

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Long duration WAV player

Post by pfalcon » Sun Apr 26, 2015 4:12 pm

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.)
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

MattMatic
Posts: 13
Joined: Wed Apr 22, 2015 1:44 pm

Re: Long duration WAV player

Post by MattMatic » Sun Apr 26, 2015 5:33 pm

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.

Post Reply