Shop OBEX P1 Docs P2 Docs Learn Events
Loading WAV files into EEPROM for playback? — Parallax Forums

Loading WAV files into EEPROM for playback?

WBA ConsultingWBA Consulting Posts: 2,935
edited 2010-12-16 11:27 in Propeller 1
After a bit if searching across the forums, I didn't find a clear answer on my question, so here goes:

I would like to make an extremely simple circuit that consists of a prop, crystal, 64k EEPROM, and a tiny speaker. When powered, all I want it to do is play a 4 second wave file, that is only speech quality.

My question: How do I get the WAV file into the EEPROM and what WAV player Object/Code snippet would you recommend?

thanks!

Comments

  • RaymanRayman Posts: 14,889
    edited 2010-12-16 05:35
    I have a wav player in OBEX that plays embedded WAV files in HUB RAM.
    You could use Mike Green's EEPROM code to move different files in and out of HUB RAM from an EEPROM and then play them...
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2010-12-16 10:44
    Thanks! I took a quick look at the "PlayWav_8bit.spin" in your WAV Players Object and it looks like an off the shelf program for what I am looking for. Since I will probably not be changing the WAV file after it is loaded into the setup, I can use this without trying to figure out how to change the data in the EEPROM after it's loaded by the PropTool IDE.

    It also looks like if my WAV files are small enough, I could define two separate wav files in the DAT section. However, after looking at a few WAV file samples, I think my 4 second WAV file will be about 30k. In that case, I will need to figure out how to make use of a larger EEPROM.

    A little more light on the project: the 4 second WAV file would be a string of up to 8 digits. So, I guess I could just load separate 0-9 WAV files and call them out as needed and comment out the ones not used. For example, to play "17567", I only need to call out 1,5,6,and 7 WAV files and then just play them back to back in the code. Taking a look at the "number" WAV files from Gadget Gangster's Propeller Popcorn Clock, my "17567" example would need 66kb of space. Those are 16 bit mono WAV files, but still makes me believe that I would need more than than the standard 32kb on the Prop for the WAV file storage so I do need to figure out how to get the WAV data into a larger EEPROM.
  • Nick McClickNick McClick Posts: 1,003
    edited 2010-12-16 11:27
    What about using Phil's Text-to-Speech stuff? I did a tutorial with it here. Clarity is hit and miss, but I'd trust it to read numbers.
Sign In or Register to comment.