Playing music?


#1

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?


#2

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?


#3

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


#4

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


#5

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


#6

Here is an example: https://github.com/pokitto/PokittoLib/tree/master/Examples/PlaySFX
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.


#7

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


#8

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


#9

I will look into this tonight


#10

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


#11

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?


#12

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


#13

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


#14

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?


#15

That’s the sound


#16

This is the expected behavior? Sounds really bad.


#17

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.


#18

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?


#19

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

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


#20

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