I did some further testing. Seems the best way to determine when a sound has finished playing is to monitor the INT status bit. Just remember to clear the INT before each SET_PLAY.
The PLAY bit will not work as it does not get cleared until you change to another mode (i.e. RECORD).
The READY bit will not tell when the sound is completed playing, rather it tells you that the chip is ready to receive another SPI command (which can happen before the sound is complete when using SETPLAY).
I couldn't find how to edit the previous post, so here are the changed parts:
(obviously your start/end addresses will be different)
Code:
mainloop:
PAUSE 1000
s_addr = $049
e_addr = $07c
GOSUB isd_set_play
GOSUB isd_wait_int
GoSub isd_clr_int
PAUSE 1000
s_addr = $07d
e_addr = $093
GOSUB isd_set_play
GOSUB isd_wait_int
GoSub isd_clr_int
GoTo main_loop
'--------------------------------------------------------------------------
isd_wait_int:
GOSUB isd_rd_status
IF isINT = 0 THEN isd_wait_int
RETURN
Bookmarks