voxforge.org
VoxForge Dev

Changeset 4

Show
Ignore:
Timestamp:
04/09/07 01:34:55 (2 years ago)
Author:
jesse
Message:

Allow user to skip a recording and move on to the next one. This required a change in the way the next item is handled. Also, added VIM markings to the bottom of the file.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/extensions_voxforge.conf

    r3 r4  
    44[custom-voxforge] 
    55exten => s,1,Set(ran-init=0) 
    6 exten => s,2,Flite("Welcome to the Vox Forge automated reecording system!") 
    7 exten => s,3,Goto(custom-voxforge-license|s|1) 
     6exten => s,2,Set(ran-instructions=0) 
     7exten => s,3,Flite("Welcome to the Vox Forge automated reecording system!") 
     8exten => s,4,Goto(custom-voxforge-license|s|1) 
    89exten => i,1,Goto(s|2) 
    910 
     
    4950exten => s,1,Flite('OK, you chose ${agerange}. Press 1 if this is correct. Press 2 to try again.'|12) 
    5051exten => 1,1,Set(num-complete=0) 
    51 exten => 1,2,Goto(custom-voxforge-selectscript|s|1) 
     52exten => 1,2,Set(num-complete-this-round=0) 
     53exten => 1,3,Goto(custom-voxforge-selectscript|s|1) 
    5254exten => 2,1,Goto(custom-voxforge-agerange|s|1) 
    5355exten => i,1,Flite('Sorry, that is not a valid choice.'|1234567890) 
     
    315317exten => s,4,Gosub(sub-voxforge-instructions|s|1) 
    316318exten => s,5,Flite('Now, press 1 if you are ready to hear a phrase. Or press 2 to hear these instructions again.'|12) 
    317 exten => 1,1,GotoIf($["${last-prompt-priority}" = "nan"]?4
     319exten => 1,1,GotoIf($["${last-prompt-priority}" = "nan"]?20
    318320exten => 1,2,System(rm ${RECORDED_FILE}.wav) 
    319321exten => 1,3,Goto(50|${last-prompt-priority}) 
    320 exten => 1,4,Goto(50|1) 
     322exten => 1,20,Set(ran-instructions=1) 
     323exten => 1,21,Goto(50|1) 
    321324exten => 2,1,GotoIf($["${last-prompt-priority}" = "nan"]?20) 
    322 exten => 2,2,System(mv ${RECORDED_FILE}.wav ${session-dir}/rec-${last-prompt-priority}.wav) 
    323 exten => 2,3,System(grep -R --no-filename ${last-prompt-name} /voxforge-code/prompts/ >> ${session-dir}/prompts) 
    324 exten => 2,4,Set(num-complete=$[${num-complete} + 1]) 
    325 exten => 2,5,Goto(50|$[${last-prompt-priority} + 1]) 
     325exten => 2,2,Gosub(sub-voxforge-get-next|s|1) 
    326326exten => 2,20,Goto(s|1) 
    327 exten => 3,1,GotoIf($["${last-prompt-priority}" = "nan"]?4
     327exten => 3,1,GotoIf($["${last-prompt-priority}" = "nan"]?20
    328328exten => 3,2,Gosub(sub-voxforge-hrecord-compare|s|1) 
    329 exten => 3,4,Goto(2|1) 
    330 exten => 10,1,Flite('Do they sound the same? Is your reecording free of laugh ing.... Cough ing.... Stutter ing.... Mispronunciations.... And background noise? Press 1 to try again. Press 2 to continue. Press 3 to hear your reecording again.'|123) 
     329exten => 3,20,Goto(2|1) 
     330exten => 4,1,Flite('OK, skipping this prompt and try ing the next one...') 
     331exten => 4,2,System(rm ${RECORDED_FILE}.wav) 
     332exten => 4,3,Gosub(sub-voxforge-do-next|s|1) 
     333exten => 10,1,Flite('Do they sound the same? Is your reecording free of laugh ing.... Cough ing.... Stutter ing.... Mispronunciations.... And background noise? Press 1 to try again. Press 2 to continue. Press 3 to hear your reecording again. Press 4 if the prompt is unclear and you would like to try a different reecording.'|1234) 
    331334exten => i,1,Flite('Sorry, that is not a valid choice.'|1234567890) 
    332335exten => i,2,GotoIf($["${last-prompt-priority}" = "nan"]?20) 
     
    339342exten => s,2,Setvar(last-prompt-priority=${MACRO_PRIORITY}) 
    340343exten => s,3,Setvar(last-prompt-name=${ARG1}) 
    341 exten => s,4,Flite('Here is sentence number ${MACRO_PRIORITY} out of 5:") 
     344exten => s,4,Flite('Here is sentence number $[${num-complete-this-round} + 1] out of 5:") 
    342345exten => s,5,Playback(jaiger/${last-prompt-name}) 
    343346exten => s,6,Record(/tmp/voxforge-%d:wav|0|20|) 
     
    369372 
    370373[custom-voxforge-phoneme-finished] 
    371 exten => 50,6,Gosub(sub-voxforge-phoneme-finished|s|1
     374exten => 50,6,Noop(----- ERROR: custom-voxforge-phoneme-finished - This should never happen! -----
    372375; NOTE: The below are commented out because they are already added by custom-voxforge-phoneme-explain 
    373376;exten => h,1,Gosub(sub-voxforge-unexpected-hangup-cleanup|s|1) 
     
    376379 
    377380[sub-voxforge-phoneme-finished] 
    378 exten => s,1,Flite('Congratulations! You have completed ${num-complete} phrases.') 
    379 exten => s,2,Flite('We appreciate your contribution. Please complete 5 more.') 
    380 exten => s,3,Flite('Press 1 to complete 5 more. Or Press 9 to hang up.'|12) 
    381 exten => 1,1,Goto(custom-voxforge-selectscript|s|1) 
     381exten => s,1,Set(num-complete-this-round=0) 
     382exten => s,2,Flite('Congratulations! You have completed ${num-complete} phrases.') 
     383exten => s,3,Flite('We appreciate your contribution. Please. Take a moment to complete 5 more.') 
     384exten => s,4,Flite('Press 1 to complete 5 more. Or Press 9 to hang up.'|12) 
     385exten => 1,1,Gosub(sub-voxforge-do-next|s|1) 
    382386exten => 9,1,Flite('Thank You for your contribution. Please call again soon.') 
    383387exten => 9,2,Playback(vm-goodbye) 
    384388exten => 9,3,Hangup() 
    385 exten => 9,4,Macro(voxforge-autosubmit) 
    386 exten => i,1,Flite('Sorry, that is not a valid choice.'|1234567890) 
    387 exten => i,2,Goto(s|1) 
    388 exten => h,1,Macro(voxforge-autosubmit) 
     389exten => 9,4,Gosub(sub-voxforge-autosubmit|s|1) 
     390exten => i,1,Flite('Sorry, that is not a valid choice.'|1234567890) 
     391exten => i,2,Goto(s|1) 
     392exten => h,1,Gosub(sub-voxforge-autosubmit|s|1) 
     393 
     394[sub-voxforge-get-next] 
     395exten => s,1,System(mv ${RECORDED_FILE}.wav ${session-dir}/${last-prompt-name}.wav) 
     396exten => s,2,System(grep -R --exclude \'*.svn*\' --no-filename ${last-prompt-name} /voxforge-code/prompts/ >> ${session-dir}/prompts) 
     397exten => s,3,Set(num-complete=$[${num-complete} + 1]) 
     398exten => s,4,Set(num-complete-this-round=$[${num-complete-this-round} + 1]) 
     399exten => s,5,GotoIf($[${num-complete-this-round} < 5]?20) 
     400exten => s,6,Gosub(sub-voxforge-phoneme-finished|s|1) 
     401exten => s,20,Gosub(sub-voxforge-do-next|s|1) 
     402 
     403[sub-voxforge-do-next] 
     404exten => s,1,GotoIf($[${last-prompt-priority} < 5]?2:3) 
     405exten => s,2,Goto(${last-prompt-context}|50|$[${last-prompt-priority} + 1]) 
     406exten => s,3,Goto(custom-voxforge-selectscript|s|1) 
     407 
    389408 
    390409[sub-voxforge-init] 
     
    405424 
    406425[sub-voxforge-instructions] 
    407 exten => s,1,Flite('OK, this is how it works: I will reed a phrase to you. Then you will hear a beep.') 
    408 exten => s,2,Flite('After the beep, please wait for 1 second.') 
    409 exten => s,3,Flite('Then you say out loud the phrase you just herd.') 
    410 exten => s,4,Flite('Wait another second and then press the pound key.') 
    411 exten => s,5,Flite('Some phrases sound silly. Or strange.') 
    412 exten => s,6,Flite('Please avoid Laugh ing... Cough ing... Stutter ing.... Mispronunciations....  And background noise.') 
    413 exten => s,7,Flite('If any of these things happen. Please go back and reecord the phrase again.') 
    414 exten => s,8,Return() 
     426exten => s, 1,GotoIf($[${ran-instructions} = 1]?2:3) 
     427exten => s, 2,Return() 
     428exten => s, 3,Flite('OK, this is how it works: I will reed a phrase to you. Then you will hear a beep.') 
     429exten => s, 4,Flite('After the beep, please wait for 1 second.') 
     430exten => s, 5,Flite('Then you say out loud the phrase you just herd.') 
     431exten => s, 6,Flite('Wait another second and then press the pound key.') 
     432exten => s, 7,Flite('Some phrases sound silly. Or strange.') 
     433exten => s, 8,Flite('Please avoid Laugh ing... Cough ing... Stutter ing.... Mispronunciations....  And background noise.') 
     434exten => s, 9,Flite('If any of these things happen. Please go back and reecord the phrase again.') 
     435exten => s,10,Return() 
    415436 
    416437[sub-voxforge-unexpected-hangup-cleanup] 
    417438exten => s,1,System(rm ${RECORDED_FILE}.wav) 
    418439exten => s,2,GotoIf($[${num-complete} < 5]?5) 
    419 exten => s,3,Macro(voxforge-autosubmit
     440exten => s,3,Gosub(sub-voxforge-autosubmit|s|1
    420441exten => s,4,Return() 
    421442exten => s,5,Noop(----- Only completed ${num-complete} so will not submit -----) 
    422443exten => s,6,System(mv ${session-dir} /voxforge-audio/partial/) 
    423444 
    424 [macro-voxforge-autosubmit] 
    425 exten => s,1,System(echo '${num-complete}' > ${session-dir}/num-complete) 
     445[sub-voxforge-autosubmit] 
     446exten => s,1,System(echo \'${num-complete}\' > ${session-dir}/num-complete) 
    426447exten => s,2,System(mv ${session-dir} /voxforge-audio/complete/) 
    427448exten => s,3,Noop(----- Auto Submit of ${num-complete} phrases - Not Implemented Yet -----) 
    428449 
     450; vim: set ts=8 sw=2 filetype=asterisk: