Author Topic: Playing Music with the DigiX  (Read 10724 times)

TimO

  • Newbie
  • *
  • Posts: 36
Playing Music with the DigiX
« on: March 09, 2014, 09:18:31 am »
Out of curiosity, I just dropped the example code from the Arduino for the Due Audio library here straight onto the DigiX, and aside from changing the filename, it worked!

Admittedly, the first time it sounded like the Chipmunks were singing, but adjusting the sampling rate in the code from 88200 to 44100 cured that.  I took absolutely no care with generating the WAV file, I just dropped an MP3 into Audacity and saved it as a WAV file using all the default settings!

When I've got more time, I may see how much effort would be involved in getting an MP3 software decoder onto the DigiX, but I suspect it's a fairly non-trivial amount of work to extract the necessary bits of code from something like the LAME library.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Playing Music with the DigiX
« Reply #1 on: March 09, 2014, 12:59:01 pm »
That link is on my list of things, I would like to try to bring to the digiX: https://github.com/watterott/WebRadio

TimO

  • Newbie
  • *
  • Posts: 36
Re: Playing Music with the DigiX
« Reply #2 on: March 15, 2014, 07:50:04 am »
Rather than trying to sort out how MP3 works, I'm thinking that maybe the Ogg Vorbis reference decoder, possibly Tremor would be less challenging to sort out.

Since I don't care too much about complete flexibility, and being standard, I may see if I can extract just a subset of the complete standard, and then I can encode music using just a specific configuration of a prebuilt PC binary (and for that matter, I'll only need the decoder for this this, not the encoder).

TimO

  • Newbie
  • *
  • Posts: 36
Re: Playing Music with the DigiX
« Reply #3 on: March 15, 2014, 09:01:10 am »
... (and for that matter, I'll only need the decoder for this this, not the encoder).

After further investigation, Tremor is only a decoder, so that's a minor issue sorted. :)

TimO

  • Newbie
  • *
  • Posts: 36
Re: Playing Music with the DigiX
« Reply #4 on: March 16, 2014, 01:36:32 pm »
After realising how damned difficult it's going to be, to extract what I need from any of these libraries, I'm wondering whether having an initial hack using something like ADPCM is likely to be more practical, and a lot easier!