I had a similar problem with it only playing the first blip of the file. Here's what worked for me. First, I had to use asyncPlayVoice, then add a delay equal or longer to the length of the file being played. This keeps the busy led on while the file is playing. I don't think I ever got PlayVoice to work, and it wouldn't play a file named 0000, the first one it would play was 0001.
My test program only played one file repeatedly, the delay just kept the loop from repeating and interrupting and restarting playing the file. I think I'll add a millis reading like the blink without delay example so the delay does not stop the program from running anything else waiting for the file to finish playing. This might get messy if there are a lot of files with different lengths. Unfortunately, I just fried my module tonight by absentmindedly hooking it up to 5V! Time to order a few more.
Syncplay usually works better with long audio files.
My module (v1.5) plays sounds only about 0.25sec from each file. I have used library from this post (synch and asynch playing). SD card is 64MB FAT16. I have downloaded ad4 and wav-files from this topic. http://arduino.cc/forum/index.php?topic=110924.0 Help me.
Even tried using pin change interrupts, thought maybe it just the delay in reading the digitalRead status for the pins.
Basically, what I wanted to achieve, is that whenever a button is pressed, it will interrupt the currently playing sound clip and play the sound clip associated with the button that was pressed (Even if it was the same button).
Here's the code I'm using: I'm using the pinchangeint library.
Code:
/* Example: Control a WTV020-SD-16P module to play voices from an Arduino board. Created by Diego J. Arevalo, August 6th, 2012. Released into the public domain. */
int resetPin = 2; // The pin number of the reset pin. int clockPin = 3; // The pin number of the clock pin. int dataPin = 4; // The pin number of the data pin. int busyPin = 5; // The pin number of the busy pin.
#define BUTTON01 7 #define BUTTON02 8
/* Create an instance of the Wtv020sd16p class. 1st parameter: Reset pin number. 2nd parameter: Clock pin number. 3rd parameter: Data pin number. 4th parameter: Busy pin number. */
Weird, cause If you check my previous video, that's what I am doing. Music is playing, I hit the trigger and plays a new sound. Even the fire selector plays it own sound. It should be there something wrong in the source code, not in the module.
For those wondering how this audio module works with music, here you have an example:
By the way, everything is now working with 3.3v. I just bought a new Mini Pro working at 8Mhz 3.3V, downloaded the same program I did for the previous Arduino and tada, worked out like a charm.