Media_InsertQuickTime ( path )
Media_InsertQuickTime inserts a sound file or other QuickTime element into a container field.
Parameter | Description |
---|---|
Result | An optional target field to receive any error. Will be left empty when there is no error. |
path | the file path or URL for the sound or QuickTime file to be inserted |
You can also use a Web URL for the path. In that case, the file is downloaded and a reference to it is returned.
Inserting Remote Sound Files
MediaManager uses a workaround that sidesteps a bug in QuickTime on Windows that causes a FileMaker Pro crash when inserting sound files from a remote volume.
See the Media_Set function for more information on controlling the workaround and its warning dialog.
Remote File Warning Dialog
The first time (after launching FileMaker Pro) that you call Media_InsertQuickTime to insert a sound file from a remote volume, the following dialog will be displayed.
“MediaManager’s Media_InsertQuicktime is about to us a workaround for a bug in QuickTime while accessing remote media. This workaround may cause the FileMaker script to fail. Please see the documentation for Media_InsertQuickTime for complete information.”
You can use the Media_Set function if you wish to prevent the dialog from appearing.
Examples
To insert a sound file named “flute.wav” located in the default folder:
Set Field [ MyTable::Container ;
Media_InsertQuickTime ( "flute.wav" ) ]
To insert “drums.m4a” located on the desktop:
Set Field [ MyTable::Container ;
Media_InsertQuickTime (".D/drums.m4a") ]
To allow users to select a sound file to be inserted:
Set Field [ MyTable::FileName ;
Media_SetDefaultFolder (
".U:Select a sound file"
) ]
Set Field [ MyTable::Container ;
Media_InsertQuickTime (
MyTable::FileName
) ]
To make the inserted sound reference stable (so it won’t be lost on shut down) by converting and outputting it as a WAV file:
Set Field [ MyTable::FileName ;
Media_SetDefaultFolder (
".U:Select a sound file"
) ]
Set Field [ MyTable::Sound Original ;
Media_InsertQuickTime (
MyTable::FileName
) ]
Set Field [ MyTable::Sound Converted ;
Media_ConvertSound (
MyTable::Sound Original ;
"soundConverted.wav" ;
"57415645" ;
MyTable::WAV Settings
) ]