Arduino library for WTV020-SD-16P audio module

SIR I JUST WANT TO ASK THE CONNECTIONS OF PINS OF THE WTV020 TO THE ARDUINO OF YOUR SAMPLE PROGRAM..

AND THE CONNECTIONS OF THE SPEAKER IN WTV020 MODULE OF YOUR SAMPLE PROGRAM.. THANKS...

SCHEMATICS SIR PLEASE.. :astonished:

1st page second post shows how to hook up the module. :wink:

MAY I ASK SIR WHAT SHOULD I DO FOR THE P02,P03 AND P07 CONNECTIONS?

MY CIRCUIT DONT WORK.. AND THERE SEEMS TO HAVE AN ERROR IN THE PROGRAM? THANKS!

For the pins you mention:

  1. You can hook them up to buttons like the schematic shows, for manual control of tracks.
  2. You can leave them disconnected and unused (maybe use 0.1uf ceramic cap to grnd).

As for the program you are using and what you are trying to accomplish, you must post that if you want help with it.

And please stop SHOUTING. :wink:

i cant get my own soundfiles to work with this module.
Can anyone tell me the exact settings to convert an mp3 into an ad4 file?
Must the mp3 mono? Which sampletype? Bitrate and so on must the source mp3 or wav??
the original sample files works fine!!

Hey.
I can't download library in this topic.
Link isn't working:
"Error 503 Service Unavailable"
Where can i download this Library?

I'm having the same issue, can anyone that has it re-upload the library?

Will re-upload the library this night from home.

And what about re-upload?

Edited fist post. Hope this helps.

Unfortunately I still cannot access the library, clicking the link still pulls up the same error page.

Hi Rebel, (and all the readers aswell... :wink: )

I downloaded right now the library and when unpacked I see TWO identical files.

One of them named: Wtv020sd16p.cpp
Another one named: Wtv020sd16p.cpp~
Both them 2183bytes.

Is that correct??

Gracias,
Rafa.

I think it's okay, the Wtv020sd16p.cpp~ might just be a temporary file that was not deleted.

Thanks to Rebel for the Library! I got it to work on my module, after trying several SD-Cards. Talk about this thing is picky with SD-Cards.

Does anyone have any idea on how to interrupt the currently playing voice, and play another one when a button is pressed?

I tried modifying rebels playVoice function into:

void Wtv020sd16p::playSound(int voiceNumber){  
 if (_busyPinState==HIGH) {
  sendCommand(STOP);
 }
 else {
 sendCommand(voiceNumber);
 }
  _busyPinState=digitalRead(_busyPin);
  while(_busyPinState==HIGH){
    _busyPinState=digitalRead(_busyPin);
 }
}

it checks for the busy pin's state, if it is HIGH, send the STOP command, and then play the voice.

Unfortunately it does not work. Or i'm just not doing it right.

Why not use .stopVoice method?

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.

nice job!..

the only difference should be the audio files you use now.. (making sure it for a 8MHz instead of 16Mhz) :slight_smile:

now you just gotta merge everything together (Arduino, Amp, SD card) into one awesome, tiny board!!! :slight_smile:

this is gonna go great for the "V" project. :slight_smile:

As a matter of fact, audio files are the same rate. There's no need in change them.
And yes, if will be a great project for the v community

no need to change them? and they play same 'rate/speed'? awesome!..

glad things finally came together..

good luck!.

the-rebel-agent:
Why not use .stopVoice method?

Thank you for the reply.

I tried that too.

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.

/*
 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.
 */

#include <Wtv020sd16p.h>
#include <PinChangeInt.h>

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.
 */

Wtv020sd16p wtv020sd16p(resetPin,clockPin,dataPin,busyPin);

void playSound01(){
  wtv020sd16p.stopVoice();
  wtv020sd16p.playVoice(0);
}

void playSound02(){
  wtv020sd16p.stopVoice();
  wtv020sd16p.playVoice(1);

void setup() {
  //Initializes the module.

  pinMode(BUTTON01, INPUT);
  digitalWrite(BUTTON01, HIGH);
  PCintPort::attachInterrupt(BUTTON01, &playSound01, RISING);
  
  pinMode(BUTTON02, INPUT);
  digitalWrite(BUTTON02, HIGH);
  PCintPort::attachInterrupt(BUTTON02, &playSound02, RISING);
  
  wtv020sd16p.reset();
}

void loop() {
 
}

xl97:
no need to change them? and they play same 'rate/speed'? awesome!..

glad things finally came together..

good luck!.

There is no need cause the Arduino is not managing WTV clock. Only clock provided from Arduino is to control the commands you send to it.