Took some digging but I found it. Hopefully this works for you. The modification was actually within the 'getWaveFormat' function. It basically reads all the necessary format info from the wave file header, and then sets the play start position of the file.
Basically when you want to play the file, create a new object of SoundPlayer with the filename as an argument. The sound will play automatically, and should emit the signal 'soundDone()' when done.
ex:
SoundPlayer *sPlay = new SoundPlayer(fName, this); //sound will start playing automatically
connect(sPlay, SIGNAL(soundDone()), SLOT(soundDone())); //delete the sPlay object when done
SoundPlayer *sPlay = new SoundPlayer(fName, this); //sound will start playing automatically
connect(sPlay, SIGNAL(soundDone()), SLOT(soundDone())); //delete the sPlay object when done
To copy to clipboard, switch view to plain text mode
Probably the SoundPlayer code could be optimized quite a bit. I only focussed on getting it working, then when I did I happened to move on to another project (typical!).
Cheers,
James
Bookmarks