Recording audio

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
dalkin
Posts: 100
Joined: Wed Jul 04, 2007 2:32 am
Location: Blackheath, Australia
Contact:

Recording audio

Post by dalkin » Thu Apr 30, 2020 3:18 am

I just can't get my head around using cameraControlSet and cameraControlDo for a Windows version of my app .. I'm trying to enable user recorded audio and playback so the script refers to buttons to enable this. I've got this far but no further. Can anyone spot the blindingly obvious issue? I've obviously been locked in isolation with my wife too long. mergeMicrophone is working fine on OSX.

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
If you're skating on thin ice you might as well dance.

SparkOut
Posts: 2170
Joined: Sun Sep 23, 2007 4:58 pm

Re: Recording audio

Post by SparkOut » Thu Apr 30, 2020 7:32 am

I have not checked properly and can't test on computer, but first thing I noticed was the cUserDefinedRecordingFolder being checked as a property of "this card" in one place and of "this stack" in another.
Actual playback code I haven't studied.

dalkin
Posts: 100
Joined: Wed Jul 04, 2007 2:32 am
Location: Blackheath, Australia
Contact:

Re: Recording audio

Post by dalkin » Thu Apr 30, 2020 9:01 am

Yep. It's the way it works on the OSX version (and works well) .. Windows may have some snafu but I don't know the system environment well enough. I'm pretty sure that the problem is with cameraControlSet and cameraControlDo but I can't find a combination that works.
If you're skating on thin ice you might as well dance.

dalkin
Posts: 100
Joined: Wed Jul 04, 2007 2:32 am
Location: Blackheath, Australia
Contact:

Re: Recording audio

Post by dalkin » Sat May 02, 2020 9:37 am

Moved to the LC complete beginners board.
If you're skating on thin ice you might as well dance.

Post Reply

Return to “Windows”