Sorry about the cross-post.
As the file I want to loop is just a voice command, I decided to repeat it multiple times with the pauses in between for a surplus duration of what I require at this site:
http://www2.research.att.com/~ttsweb/tts/demo.php
This eradicates the need to programme it to loop and so now I simply need to turn the file ON or OFF via 2 RF transmitters and 1 receiver.
The video you posted was really helpful and I hope to adapt the receiver code. 1 transmitter will be dedicated to turning it ON, the other OFF, each transmitter will be coupled with an Encoder and a tilt switch.
Here is the code I'm using to play the Wave Module:
int RST = 3;
int CLK = A5;
int DAT = A4;
void setup() {
pinMode(RST, OUTPUT);
pinMode(CLK, OUTPUT);
pinMode(DAT, OUTPUT);
digitalWrite(RST, HIGH);
digitalWrite(CLK, HIGH);
digitalWrite(DAT, HIGH);
digitalWrite(RST, LOW);
delay(5);
digitalWrite(RST, HIGH);
delay(300);
}
void loop() {
send(0x0000);//play file 0000
delay(10000);//delay 10 seconds
send(0xfff0);//set voice volumn to 0 (turn off)
delay(3000);
send(0xfff4);//set voice volumn to 4
delay(3000);
send(0xfff7);//set voice volumn to 7
delay(3000);
send(0xfffe);// pause
delay(5000);
send(0xfffe);//play
while(1);
}
void send(int data)
{
digitalWrite(CLK, LOW);
delay(2);
for (int i=15; i>=0; i--)
{
delayMicroseconds(50);
if((data>>i)&0x0001 >0)
{
digitalWrite(DAT, HIGH);
//Serial.print(1);
}
else
{
digitalWrite(DAT, LOW);
// Serial.print(0);
}
delayMicroseconds(50);
digitalWrite(CLK, HIGH);
delayMicroseconds(50);
if(i>0)
digitalWrite(DAT, LOW);
else
digitalWrite(DAT, HIGH);
delayMicroseconds(50);
if(i>0)
digitalWrite(CLK, LOW);
else
digitalWrite(CLK, HIGH);
}
delay(20);
}
However I don't know how I would combine the two codes for what I require :S