Media_RecordSoundStart ( path { ; inBackground { ; parameters } } )
Media_RecordSoundStart gives you the ability to record sounds of any length either directly into a container or as an external sound file stored as a reference.
Parameter | Description |
---|---|
path | Location and file name of the external sound file to be created. With synchronous (non-background) recording, leave this parameter blank if you want to store the recorded sound directly in the container field. |
inBackground | Optional parameter. “1” or “True” to record asynchronous in background, or “0” or “False” to record synchronous within FileMaker. |
parameters | Optional parameter. Recording settings obtained from Media_RecordSoundFormatDialog. Settings from Windows are not compatible with settings from Mac and vice versa. |
FileMaker Pro’s built-in sound recording capability only records directly into the container field and limits the recorded sound duration to a maximum of about one minute in length. MediaManager’s record sound functions (Media_RecordSoundStart, Media_RecordSoundPause, Media_RecordSoundStop) entirely expand your ability to record sounds through FileMaker Pro. They give you the ability record sounds of any length, as well as the capability to store the recording as an external sound file that is stored in the container field as a QuickTime reference.
Synchronous or Asynchronous Recording
Just as with Media_PlaySound, this function can record synchronously or asynchronously.
Synchronous recording pauses other FileMaker operations until you are done recording. To manually stop recording, click outside of the destination container field, type ESC, or use CMD+period.
Asynchronous recording occurs in the background, even when FileMaker is no longer the frontmost active window. To stop asynchronous recording, use the Media_RecordSoundStop function.
Synchronous and Asynchronous File References
It is also important to understand that the QuickTime file references created by the two methods of recording are different. An asynchronous recording results in a temporary QuickTime file reference that is valid only until the computer is shut down. In order to make the reference to the sound file stable, you must convert/export the recorded sound file.
Doing a synchronous recording to an external file, however, results in a stable file reference that does not break when the computer is shut down.
File Formats
Synchronous recordings directly into a field (without a file path specified) are in ‘sfil’ format. All other recorded sounds are initially generic QuickTime movie format. If you are saving as an external file, the file name extension should be “.mov”.
Returns
Returns the recorded sound (or QuickTime reference) to the specified container field.
Use Media_GetLastError to check for errors.
Examples
To record within FMP directly into a container field:
Set Field [ MyTable::Sound ;
Media_RecordSoundStart (
“” ; # empty = into container
0 # 0/False in foreground
) ]
To record within FMP to a file named “NewSound.mov” (to be placed in the default folder):
Set Field [ MyTable::Sound ;
Media_RecordSoundStart (
“NewSound.mov” ; # into file
False # 0/False in foreground
) ]
To record to a file named “NewSound.mov” on the desktop, regardless of whether or not FMP is active:
Set Field [ MyTable::Sound ;
Media_RecordSoundStart (
“.D/NewSound.wav” ; # into file
1 # 1/True in background
) ]