Go Down

Topic: loop single sound on the WTV020-SD-16P (Read 1 time) previous topic - next topic


I have been playing around a bit with this sound module, both in standalone mode and using the-rebel-agent´s library.http://forum.arduino.cc/index.php?topic=117009.0

I am trying to figure out a way to retrigger the playback of a sound when it´s finished, to loop a single sound (I am aware it will not loop perfectly, I am mainly interested in just repeating the sound).
One way that works is using the asyncPlayVoice with a delay that corresponds to the sound length, but I was hoping to have a more general code that works with any sound without having to specify the length.
I tried using playVoice (which plays the sound to the end before moving on in the code) and then check the busyPin. When the playVoice has finished, I detect the pin to be low, but I am not able to retrigger any sound either using the asyncPlayVoice or the playVoice command. I also tried with reset first, but nothing happens. I added a serialcheck so I know that the code is checking the pinstate and detecting that it´s low.

Also, is there any way of looping a single sound when using the module without arduino? I assume it´s only possible to use the next/prev control?


Jul 28, 2013, 02:24 am Last Edit: Jul 28, 2013, 03:15 am by jmknapp Reason: 1
I've been playing around with one of these devices too (WTV020-SD-mini) and find it requires a bit of reverse engineering to figure out how it works. It doesn't pay to follow the data sheets out there too closely. As you've noted, the "BUSY" signal appears to be active high rather than low as the data sheet would seem to imply. Also, it's not really a BUSY signal but rather just a bit that says when the device is out of "standby" (low-power drain) mode. When a file is played, the BUSY line stays high for about one second after the play stops:

The top trace is the voltage on one of the speaker pins, the bottom trace is BUSY. The time scale is 1 second per division. The line actually goes low when the device switches to standby. BTW, it draws about 2 ma in standby as opposed to maybe 100 ma average when playing a loud sound.

So when trying to loop a sound using BUSY as a trigger there will be at least a one second gap in between plays. But there's another quirk--if you try to send another play command immediately after BUSY going low, it will be ignored. I find by trial and error that you need to delay about 10 ms after BUSY goes low to successfully wake the chip up again with a play command.

So to summarize, to loop a sound:

-- send play command
-- wait for BUSY to go low
-- wait 10 ms
-- send play command, etc.



Sorry for be late, but I recall from the data sheet that there is a setup to loop a sound. Data sheet is not very helpful, but schematic is quite clear. Never tested it

Go Up