Play mp3 file



  • Hi onioneers, I was wondering what do we need in order to play a mp3 file with our onion omega ? What is the best way to do this ? Which is the correct way to connect the speaker ? thanks in advance.



  • Hi @Jose-Mejia, We are designing an audio expansion to go with the Omega. For now there isn't a way to play audio with the Omega. However, you can try getting an USB audio adapter. There should be a driver for it made for OpenWRT.



  • Hmmmm. I was going to say that you could do a PWM signal and a small filter. I tried googling for audio from an Adruino and there are examples that go in that direction, but that requires an onboard hardware timer. I think I remember seeing that on the Omega to control servo's (PWM) you need to do it in software (count milliseconds) or in hardware like the motor shield. Is that right? @Boken-Lin



  • @Chris-Ward I was going to suggest using PWM - there is code in fast-gpio for generating PWM output and I am working on alternative C/C++ code for accessing GPIO that might make some of this more friendly. Writing in C/C++, the timer issues should not be a major problem - though an onboard hardware timer (with interrupt capability) would certainly make things a bit easier.

    However, I suspect that the original poster wanted something a bit more sophisticated which would need a fair amount of processing to convert the mp3 to a sequence of (possibly multi-channel) GPIO output.
    I would think that something with an A/D converter would be needed - it would be possible to wire up one of multiple available i2c based A/D chips but this might take quite a bit of work.



  • @Kit-Bishop you are right. I was just thinking about possibilities. I forgot by the time I posted that the poster had wanted MP3. Adafruit has some boards that could be wired up.

    https://www.adafruit.com/products/2133 - OGG/Wave
    https://www.adafruit.com/products/1381 - MP3/OGG/Wave

    These boards use a trigger to play that could come from the GPIO of the Omega. Their tutorials will show how to connect it to an Arduino, but connections will be similar.


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.