When my psychological test opens to a new card/item, it plays an audiofile that "speaks" the text displayed on screen.
Originally, I'd required the audiofile to play until done before the user registered a response, via either button or keyboard press. This worked just fine. But -- in order to speed up the test -- my client wants to terminate the audio as soon as a response is entered.
I save the full path to the audiofile in a mainstack custom property (cCurrentAudioFilePath) -- so I can identify whether the audio needs to be terminated prematurely when moving to the next item. When so, I've employed the following routine:
Code: Select all
-- NEW: TERMINATE AUDIOFILE AS SOON AS RESPONSE IS GIVEN
local tThisAudioFile
put the cCurrentAudioFilePath of stack "EAS_SABE" into tThisAudioFile
stop playing audioClip tThisAudioFile
Any help will be appreciated.
jeff k