4D v14.3PLAY |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
PLAY
|
PLAY ( objectName {; channel} ) | ||||||||
Parameter | Type | Description | ||||||
objectName | String |
![]() |
Name of sound file or Mac OS 'snd' resource or system sound Empty string for stopping asynchronous play |
|||||
channel | Longint |
![]() |
If specified, synthesizer channel and asynchronous execution; If omitted, synchronous execution | |||||
The PLAY command plays sound or multimedia files. You pass the full pathname of the file you want to play in objectName. On Mac OS, the command can also be used to play a sound resource or a system sound.
The channel parameter specifies the Macintosh synthesizer channel. If channel is not specified, the channel is used for simple digitized sounds and is synchronous. Synchronous means that all processing stops until the sound has finished playing. If channel is 0, the channel is for simple digitized sounds and is asynchronous. Asynchronous means that processing does not stop and the sound plays in the background.
To stop playing a synchronous sound, use the following statement:
PLAY("";0)
The following example shows how to play a video file on Windows:
$DocRef :=Open document("";"AVI")
If(OK=1)
CLOSE DOCUMENT($DocRef)
PLAY(Document)
End if
The following example code appears in a startup method. It welcomes the user with a sound called Welcome Sound on Macintosh:
PLAY("Welcome Sound") ` Play the Welcome Sound
Product: 4D
Theme: User Interface
Number:
290
Created: < 4D v6
Modified: 4D v11 SQL
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)
Inherited from : PLAY ( 4D v11 SQL Release 6)