Can't get the Speech Board to use sentences.
I've got a problem with my Quadravox QV356M4 Speech Board. It works fine for mixed sound and single words but when I try to store words to build a sentence the card stops working and I've got to switch off the Board of Education (USB). It won't even play mixed sound. Any ideas on what I should try?

Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I discovered the problem using the first demonstration program in the documentation:
' ============================================================================== ' {$PBASIC 2.0} ' ' File...... QV356_SPEECH.BS2 ' Purpose... QV356M4 Speech & Sound Demonstration ' Author.... Parallax ' E-mail.... stamptech@parallax.com ' Started... ' Updated... 01 MAY 2002 ' ' {$STAMP BS2} ' ' ============================================================================== ' ------------------------------------------------------------------------------ ' Program Description ' ------------------------------------------------------------------------------ ' This program demonstrates the basic speech and sound capabilities of the ' QV356M4 BOE-Bot Speech Board. ' ------------------------------------------------------------------------------ ' Revision History ' ------------------------------------------------------------------------------ ' ------------------------------------------------------------------------------ ' I/O Definitions ' ------------------------------------------------------------------------------ Term_SIO CON 16 ' DEBUG terminal I/O QV_SIO CON 11 ' serial I/O for QV356 QV_Busy VAR IN11 ' high when QV356 is busy Mix_Out CON 10 ' output to QV356 mixer ' ------------------------------------------------------------------------------ ' Constants ' ------------------------------------------------------------------------------ QV_Direct CON $F0 ' play mode QV_MixOn CON $F1 ' enable mix of pin 10 sounds QV_SetRate CON $F2 ' set sample rate (0..3) QV_MixOff CON $F3 ' disable mix of pin 10 sounds QV_Record CON $F4 ' record mode (do not use) QV_PlayUsr CON $F5 ' play user message QV_Stop CON $F6 ' stop playback QV_RecUsr CON $F7 ' record user message QV_Sleep CON $F8 ' power down QV_OpenStr CON $F9 ' open string QV_CloseStr CON $FA ' close string QV_PlayStr CON $FB ' play string QV_Volume CON $FC ' set volume (0..7) QV_Reset CON $FD ' software reset QV_80k CON $00 ' - 8.0 kHz (best quality) QV_64k CON $01 ' - 6.4 kHz QV_53k CON $02 ' - 5.3 kHz QV_40k CON $03 ' - 4.0 kHz QV_RecOn CON $01 ' start recording QV_RecOff CON $00 ' stop recording N2400 CON 16780 ' 2400-8-N-1, inverted (QV356) T9600 CON 84 ' 9600-8-N-1 (matches DEBUG) MoveTo CON 2 ' move cursor to x,y LF CON 10 ' line feed ClrRt CON 11 ' clear to right ClrDown CON 12 ' clear down Std_Volume CON 5 ' good volume for QV356 ' ------------------------------------------------------------------------------ ' QV356M4 Standard Vocabulary ' ------------------------------------------------------------------------------ LastPhrase CON 219 _calibrating CON 59 _primary CON 166 _sensors CON 189 _all CON 41 _systems CON 202 _functioning CON 109 _properly CON 171 _attempting CON 47 _to CON 205 _locate CON 131 _objects CON 151 _object CON 150 _turning CON 209 _track CON 207 _moving CON 145 _target CON 204 _30 CON 21 _9 CON 9 _located CON 132 _will_i_dream CON 217 ' ------------------------------------------------------------------------------ ' Variables ' ------------------------------------------------------------------------------ response VAR Word ' menu response qvData VAR Byte ' data for module idx VAR Byte ' loop counter eeAddr VAR Word ' ee address of word freq VAR Word ' tone for sound fx ' ------------------------------------------------------------------------------ ' EEPROM Data ' ------------------------------------------------------------------------------ Sent1 DATA _calibrating, _primary, _sensors, $FF Sent2 DATA _all, _systems, _functioning, _properly, $FF Sent3 DATA _attempting, _to, _locate, _objects, $FF Sent4 DATA _turning, _to, _track, _moving, _target, $FF Sent5 DATA _object, _30, _9, _located, $FF ' ------------------------------------------------------------------------------- ' Initialization ' ------------------------------------------------------------------------------ Initialize: PAUSE 250 ' let DEBUG open DEBUG CLS DEBUG "Initializing QV356M4", CR SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_Reset] ' reset sound board PAUSE 100 ' required -- do not change SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_Volume, Std_Volume] ' set initial volume ' ------------------------------------------------------------------------------ ' Program Code ' ------------------------------------------------------------------------------ Main: DEBUG CLS DEBUG "===========================================", CR DEBUG " QV356M4 BOE-Bot Speech Board Demonstration ", CR DEBUG "===========================================", CR DEBUG CR DEBUG " Play Selected Vocabulary Word", CR DEBUG " Sentence Demonstration Using String Buffer", CR DEBUG " Mixer demo -- Plays Sounds from Stamp", CR DEBUG CR DEBUG "--> " SERIN Term_SIO, T9600, [noparse][[/noparse]response] PAUSE 500 LOOKDOWN response, [noparse][[/noparse]"123"], response BRANCH response, [noparse][[/noparse]Vocab, Sentences, Mixer] GOTO Main Vocab: DEBUG CLS DEBUG "QV356M4 Vocabulary Demonstration", CR, CR SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_Direct] ' reset direct file mode PAUSE 5 DEBUG "Enter phrase # (999 to Exit) -> " SERIN Term_SIO, T9600, [noparse][[/noparse]DEC response] ' get phrase # IF (response = 999) THEN Main ' check for quit value IF (response > LastPhrase) THEN Vocab ' check for in range qvData = response GOSUB Say_Word GOSUB Wait_Until_Not_Busy GOTO Vocab Sentences: DEBUG CLS DEBUG "QV356M4 Queuing Demonstration", CR DEBUG "-- sentences are stored in DATA table", CR, CR FOR idx = 1 TO 5 ' get sentence address LOOKUP (idx - 1), [noparse][[/noparse]Sent1, Sent2, Sent3, Sent4, Sent5], eeAddr DEBUG MoveTo, 0, 3, "Sentence #", DEC idx GOSUB Say_Sentence GOSUB Wait_Until_Not_Busy PAUSE 1000 NEXT GOTO Main Mixer: DEBUG CLS DEBUG "QV356 Mixer Demonstration", CR DEBUG "-- sounds are generated by BASIC Stamp", CR, CR SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_MixOn] ' enable Stamp sounds PAUSE 5 SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_Volume, 6] ' crank up volume PAUSE 5 DEBUG "Dial tone", CR FREQOUT Mix_Out, 35, 35 ' "click" PAUSE 100 FREQOUT Mix_Out, 2000, 350, 440 ' combine 350 Hz & 440 Hz DEBUG "Dialing", CR DTMFOUT Mix_Out, [noparse][[/noparse]1,9,1,6,6,2,4,8,3,3,3] ' "call" Parallax DEBUG " - ringing", CR FOR idx = 1 TO 2 FREQOUT Mix_Out, 2000, 440, 480 ' combine 440 Hz and 480 Hz PAUSE 4000 NEXT DEBUG "Howler -- watch out!!!",CR FOR idx = 1 TO 4 FREQOUT Mix_Out, 1000, 1400, 2060 ' combine 1400 Hz and 2060 Hz FREQOUT Mix_Out, 1000, 2450, 2600 ' combine 2450 Hz and 2600 Hz NEXT DEBUG "1950's Sci-Fi Computer", CR FOR idx = 1 TO 50 ' run about 5 seconds RANDOM freq ' create random note freq = freq // 2500 ' don't let note go to high FREQOUT Mix_Out, 50, freq ' play it PAUSE 100 ' short pause between notes NEXT DEBUG "Spaceship Transporter" FOR freq = 5 TO 5000 STEP 5 ' frequency sweep up FREQOUT Mix_Out, 10, freq, freq */ 323 ' simple chord (1st + 3rd) NEXT DEBUG " - with QV356 voice", CR SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_Volume, 3] ' lower volume for mix PAUSE 5 qvData = _will_i_dream ' say word with sound GOSUB Say_Word FOR freq = 5000 TO 5 STEP 25 ' frequency sweep down FREQOUT Mix_Out, 10, freq ' single note NEXT INPUT Mix_Out ' float Stamp sound pin SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_MixOff] ' turn mixer off PAUSE 5 SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_Volume, Std_Volume] ' reset volume PAUSE 5 GOTO Main END ' ------------------------------------------------------------------------------ ' Subroutines ' ------------------------------------------------------------------------------ ' **************************************************** ' Makes serial line an input and checks for Busy state ' -- this line will be low when not busy ' **************************************************** Wait_Until_Not_Busy: INPUT QV_SIO ' make comm an input IF QV_Busy THEN Wait_Until_Not_Busy ' wait until busy goes low RETURN ' ************************************ ' Say a single word ' -- make sure QV356 is in Direct Mode ' before calling this routine ' ************************************ Say_Word: GOSUB Wait_Until_Not_Busy IF (qvData > LastPhrase) THEN Say_Word_Exit ' say only valid words SEROUT QV_SIO, N2400, [noparse][[/noparse]qvData] ' say word Say_Word_Exit: RETURN ' ************************************** ' Say a sentence ' -- point to sentence in EE with eeAddr ' -- limit is 40 words (no checking) ' ************************************** Say_Sentence: GOSUB Wait_Until_Not_Busy SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_OpenStr] ' open string buffer PAUSE 5 Get_Word: READ eeAddr, qvData ' read word from sentence data IF (qvData = $FF) THEN Play_Buffer ' sentence done? IF (qvData > LastPhrase) THEN Get_Word ' no -- is word valid? SEROUT QV_SIO, N2400, [noparse][[/noparse]qvData] ' yes, send word to buffer PAUSE 5 eeAddr = eeAddr + 1 ' increment word address GOTO Get_Word ' get next word Play_Buffer: SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_CloseStr] ' close string buffer PAUSE 5 SEROUT QV_SIO, N2400, [noparse][[/noparse]QV_PlayStr] ' play the buffer Say_Sentence_Exit: RETURNI also wrote a program my self to find the line that causes the malfunction. If the SEROUT QV_SIO, N2400, [noparse][[/noparse]qvData] is used the Speech Board stops and no more sound is produced.
I would modify your wait code to something like this:
Wait_Until_Not_Busy:
DO
INPUT QV_SIO ' make comm an input
IF QV_Busy THEN LOOP ' wait until busy goes low
DEBUG "Not busy", CR
RETURN
as I'm not sure how the return would work with repeated calls to Wait_Until_Not_Busy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
SEROUT QV_SIO, N2400, [noparse][[/noparse]qvData]
PAUSE 5
SEROUT QV_SIO, N2400, [noparse][[/noparse]$2A]
PAUSE 5
but neither helps. What is the difference between $2A and QV_CloseStr (or $FA) that tells the Speech Board to stop the string?
Edit: Does your version of Wait_Until_Not_Busy compile? I'm having trouble with DO LOOP in PBASIC 2.0 and IF.. THEN LOOP in PBASIC 2.5.
Post Edited (Ladnarud) : 1/22/2008 12:40:05 AM GMT
The Diphone chip set synthesizes speech from strings of phonemes; the essential constituent sounds in
human speech. The controller can store and play up to 40 phonemes without breaks or delays in
between. Before this occurs, the phoneme codes must be downloaded to the Speech Board string buffer.
The process for storing and playing a string of phoneme codes is as follows:
1. Send Open String command ($F9)
2. Send phoneme codes (up to 40) in desired order of play; string must end with $2A (silence)
3. Send Close String command ($FA)
4. Send Play String command ($FB)
From the manual page 4
Wait_Until_Not_Busy: DO INPUT QV_SIO ' make comm an input IF NOT QV_Busy THEN RETURN LOOP 'Wait_Until_Not_Busy goes lowThis might work better (2.5)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
www.elliotttech.com/myweb/Group/Group1/Group1-1.pdf
Sorry about this.