Shop OBEX P1 Docs P2 Docs Learn Events
Audio stored on eeprom — Parallax Forums

Audio stored on eeprom

JasonLightsJasonLights Posts: 8
edited 2008-07-11 13:56 in Propeller 1
Is there any sample projects out there that have audio clips (mp3, wav, or other format) on a eeprom on ether I2C or SPI bus?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-08 18:47
    Look in the Propeller Object Exchange. There's a WAV player (look in the sound section).
  • JasonLightsJasonLights Posts: 8
    edited 2008-07-08 20:01
    I found the mp3 and wav player, but they both use a sd card. I want to use an eeprom chip the hold the sound files
  • RaymanRayman Posts: 14,233
    edited 2008-07-08 20:04
    One of my wav players plays (low quality, short wav clips) from HUB ram. You could start from that...

    I don't think anybody made one to play from eeprom already.
  • JasonLightsJasonLights Posts: 8
    edited 2008-07-08 20:13
    that would be cool
  • VIRANDVIRAND Posts: 656
    edited 2008-07-08 21:14
    "Hydra Dense Music Format" program plays from eeprom.
  • tekochiptekochip Posts: 56
    edited 2008-07-09 13:34
    I have been using the HSS ADPCM format to stream audio from I2C EEPROMs.· The quality is quite good when you use 8 bit files sampled at 32KHz.· The compression·is 6:1, so you're looking at 5.3K/Sec.·
  • JasonLightsJasonLights Posts: 8
    edited 2008-07-09 15:01
    do you have any sample files I could look at?
  • tekochiptekochip Posts: 56
    edited 2008-07-10 13:42
    Why sure;

    This is a fanfare from a game I did.· The first long in the file is the data length and the second represents the sample rate.· I always use 32KHz, so the value is always $FFFFFFFE.· The rest of the file is the ADPCM.· B6 and B7 of each byte represents the magnitude of change and the other 6 bits represent the direction.· $EA is a value that should never appear as data, so I use that as an EOF·terminator.· By using a terminator I can simply stream the audio with no regard to the file size.· If you like I have a simple tool that will convert 8 bit, 32KHz .WAV files into 32KHz ADPCM.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-07-10 14:52
    Would you mind posting that tool? I'd like to have a copy of it as well.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card? - PropDOS
    Need a part? Got spare electronics? - The Electronics Exchange
  • lonesocklonesock Posts: 917
    edited 2008-07-10 16:05
    I just wanted to point out that it would be fairly easy to extend this to arbitrary bit-depths. Instead of having the delta computed as 1<<(B6+B7+B7), delta could be persistent, shifting by (B6+B7+B7-1) each byte (so SHL if >0, SHR if <0). In fact, if you made delta a negative number, and used SAR instead of SHR then you would never have to do range checking (as it could never go to 0).

    One trick when decoding delta modulation type signals is to output the average of the last two samples. This gets rid of the sawtooth wave that happens when trying to represent a flat waveform.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
  • JasonLightsJasonLights Posts: 8
    edited 2008-07-10 17:44
    Can I look at your spin files too?
  • tekochiptekochip Posts: 56
    edited 2008-07-10 20:34
    Here's the tool, you'll need .net to run it.· I'll have to get the Spin files in the morning, US Central.
  • tekochiptekochip Posts: 56
    edited 2008-07-11 13:56
    OK, here are the other two files you'll need.· The first one is the I2C that includes a streaming command.· It's really the I2C object that controls streaming because it fills the ADPCM buffer with data.· The second file is the modified HSS object.· The ADPCM was changed to have an ADPCM buffer, master volume, and the capability of two channels with a second slave object.· If there's data in the buffer the ADPCM will stream audio, once the terminator is reached the ADPCM will stop streaming.· I've used the HSS with EEPROMs, the uALFAT and the Vinculum, the only difference being the memory handling object that fills ADPCM buffer.
Sign In or Register to comment.