Pages: [1]   Go Down
Author Topic: WaveHC Play one file after the other  (Read 1165 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have this: http://www.emartee.com/product/41973/

I want to play some audio files one after the other by specifying the file name and path.

Anyone know how? The example has just confused me so much >.<
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 31541
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So do you have an SD card interface on your arduino, you need one. You need to put several WAV files on it.
You then have a list of file names to play in your arduino sketch.
You use these one at a time to open the file and transfer the file byte by byte to your card.
Then at the end of the file you need to close it and open the next one in the list.
It's not easy.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have what I linked to (and the other parts in the picture further down on the page). SO yes I have an SD Card, I'm just looking for the code to queue files to play, or even just code where I can play a file with a specific name. The example code on that page just doesn't make sense to me. I was hoping someone would already have some code I can look at.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 31541
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The example code on that page just doesn't make sense to me.
In what way? Does it work for you?

It loads and compiles on the arduino and just plays every file it sees on the SD card.
If you want to hack that to only play files on your list then it is the void play(FatReader &dir) function you want to change.
The simplest way would probably be to include a check to see if the file it is going to play is the next on your list, if not you keep looking.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I found some more example code which included a function to play a file by specifying the file name. Now that I have that code I am looking to use an array to store the file names of the next few sounds then make it check the array to see if there are any sounds that need to be played.
Logged

Pages: [1]   Go Up
Jump to: