Here's my code, let me know what you think!
Code: Select all
on recordme # mouseup of Record Me button
global gRecordOn
if gRecordOn is false then
put true into gRecordOn
set the coloroverlay[opacity] of button "recordme" to "0" # visible indication of recording
set the recordFormat to "aiff"
set the recordCompression to "raw"
record sound file "currentprompt.aif" # self-recorded audio for user to listen to if desired
else if gRecordOn is true then
put false into gRecordOn
set the coloroverlay[opacity] of button "recordme" to "150"
stop recording
end if
end recordme
on playme # Mouseup of Play Me button
if URL("file:currentprompt.aif") is empty then
answer "Microphone did not record."
else
play "currentprompt.aif"
end if
end playme
Ivan