I kneed to know when my tone generator has stopped playing.
I want to play the dtmf tone for 50 ms and then wait 50 to play the next tone. i wanted to use this code.
private void playtones() {
new Thread(new Runnable() {
public void run() {
for(int i=0 ; i<=19 ; i++){
dtmftone.startTone(savetone.get(i) , 50);
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
).start();
}
The sleep starts before the tone has stopped playing. How can i check that the tone has stopped playing? Or is there at better way to do this?
Thx for the help.