Playing music?

How to play music?
Looked on the forum was hard to find current info.
What to use to create files, How to load and play them in mbed?

Do you want to play music stored to a SD card, e.g. a wav or mp3 file, or play notes you give in a C++ program?

What is the difference in quality?
Do you use both? One background other for effects?

The music stored in SD has the best overall quality. You can play simultaneous sound effects too.

How to use it? What file type is best used and setting for that?

Here is an example:
Note that playing from SD is commented out in *.cpp/h.

Both the music and the sound effect should be in “raw 8-bit unsigned format”. E.g. Audacity can convert multiple formats to that.

Code provided is not working, Compiled and runs showing A or B but no sound is playing, Volume is set to max

How to use SD part? Compiler error about missing SDFDisk.h

@Hanski Im using Mbed, Is library there outdated?
How to import github repo into mbed?

1 Like

I will look into this tonight

Tested PlaySFX.bin from github repo, Has no sound on hardware or emulator

I have just downloaded that bin and it works on hardware. When I hold down B or C I hear the sound
EDIT did you set the volume above zero after the pokitto start up screen?

Yes, Put it on max and there is a faint click wen i press the button.
What about emulator?

I am not sure if there is sound in the emulator…

Plugged in a speaker and do get some sound, Is it supposed to make constant buzzing sound?
Pressing buttons makes a machine gun sound is that how its supposed to sound?

That’s the sound

This is the expected behavior? Sounds really bad.

I don’t know how it sounds of course at your side. Maybe try some games that play music?
For example this one: [Game]Matti’s Nightmare

On my pokitto this game sounds good.

Stil Background noise wen on the volume screen.
Sound seems way better then the sample code.
My speaker seems to be broken.

Can the aux do stereo sound?

What do you mean? Does the game sound good on your pokitto or not?

I am not sure but I don’t think so…

Yes, it sounds good but is streamed from sd card. How to play sound of sd card?