Playing music?


#21

you can play music from sd card with [Tool]Xploritto (WIP) (only unsigned 8-bit mono at 11024 Hz).


#22

Where are you downloading these .bins from?
I can’t find one on the repo @Hanski linked to…

I’m partly wondering if there’s a compiler problem at the root of this.


#23

#24

Huh, GitHub’s file finder is failing me then.

If I use the file finder to search for .bin I only get PokittoLib/Examples/Aquarium256/Aquarium256.bin showing up.


#25

How to do that in code?


#26

add this to My_settings.h

#define PROJ_ENABLE_SOUND 		1
#define PROJ_STREAMING_MUSIC 	1
#define PROJ_AUD_FREQ           11025

call this function to start playing a file

Pokitto::Sound::playMusicStream("path to file.raw",0);

to stop the playback

Pokitto::Sound::pauseMusicStream();

#27

You are faster than me…
I have also made an example.


#28

Thank you @bl_ackrain and @sbmrgd.
With some trail and error i got my own files to work. There seems to be a file name length restriction.
Would it be possible to run load music and data from a folder directory


#29

yes, i am using folders in [Game]Celeste classic and it work fine.

Pokitto::Sound::playMusicStream("Celeste/music/music0.raw", 0);

if you want to load data and music you will need to use SDFS library because PFFS can only open one file.


#30

I had "SakuraWarsTest.raw" and that did not load but renaming file to "p1.raw" did work.
How to run music on SDFS?


#31

to use SDFS for streaming you can add this line to My_settings.h

#define PROJ_SDFS_STREAMING         1

#32

PFFS does not support long file names, so it can’t be more than 8 characters long.


#33

Thanks, suspected something like that was up. Reason to use PFFS as default?
Mutliple file systems making this confusing


#34

I suppose it’s because PFFS occupies much less space in flash, leaving more room for game code.