Looking for SPI and ISD4004 help or code examples

I've googled a lot without any luck. I'm new to SPI programming and I was wondering if someone had an example of code controlling an ISD4004 sound recording chip. I programmed my own but all I get is clicks when the recording and playback starts and stops.

From reading the specsheet I can't figure out in what order to send the commands. The spec sheet is here: http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ConsumerElectronicsIC/ISDVoiceIC/ISDChipCorder/Documents/ISD4004.pdf

For example, I'm telling it to playback from address 0x0 this way:

...
const byte POWERUP = B00100000;
const byte SETREC = B10100000;
const byte REC = B10110000;
const byte SETPLAY = B11100000;
const byte PLAY = B11110000;
const byte STOP = B00110000;
const byte ADDRESSZERO = 0x0;
...
int startPlay() {
  // select ISD4004
  digitalWrite(slaveSelectPin,LOW);
  // send address and value
  SPI.transfer(SETPLAY);
  SPI.transfer(ADDRESSZERO);
  SPI.transfer(ADDRESSZERO);

  SPI.transfer(PLAY);
  // deselect ISD4004
  digitalWrite(slaveSelectPin,HIGH);  
}

Does this make sense?

I'll appreciate any help.

Show us the full code. For example: how have you initialized the SPI bus?

A quick overview of the datasheet let me believe that you always have to submit the two address bytes and the third byte is the command byte. The address bytes have to be transmitted even if they have no meaning given the current command opcode.

Thanks pylon. I got it figured out. What had me confused was the fact that I found two different versions of the datasheet and they had the bits in different orders. One specified that the communication is LSB first and had the data printed in that order (i.e. with the LSB on the left). The second one didn't mention anything about LSB ordering and had the data printed with the LSB on the right.

Cheers!