Code: Select all
on mouseUp
put the cUserDefinedRecordingFolder of this card into tUserFolder
## User did not define a folder yet:
if there is not a folder tUserFolder then
answer folder "Select a folder for the recordings:"
if the result is cancel then
exit to top
end if
## We store the folder also in a custom property:
set the cUserDefinedRecordingFolder of this stack to IT
## We need this in this script:
put it into tUserFolder
end if
set the recordFormat to "wav"
ask "Please name the recording:"
if it = empty then
exit to top
end if
put it into tUserDefinedName
put tUserFolder & "/" & tUserDefinedName & ".wav" into tFile
## Now set two custom properties fo the PLAY1 button, so the button knows what to play when clicked!
set the cAudioFile of btn "play1" to tFile
set the filename of player "P1" to tFile
set the cUserDefinedName of btn "play1" to tUserDefinedName
cameraControlSet "MyCamera", "audioDevice", "default"
cameraControlDo, "MyCamera", "startRecording", "tUserDefinedName"
set the label of button "Record1" to "Recording"
set the backgroundcolor of button "Record1" to orange
##
end mouseUp