-
Notifications
You must be signed in to change notification settings - Fork 0
Class Sound
Kristian Virtanen edited this page Oct 16, 2024
·
1 revision
The Sound
class provides methods for playing system sounds and audio files, as well as controlling playback, including stopping, pausing, and waiting for playback to complete. It also handles errors through the LastError
property, which stores the most recent error message if an operation fails.
-
Description: Stores the last error message, if any operation fails, including a timestamp in
yyyy-MM-dd HH:mm:ss
format. -
Example:
"2024-10-16 14:30:00: Error pausing file: File not found."
- Description: Plays the system click sound (Asterisk).
- Description: Plays the system click sound (Asterisk) and waits sound to stop.
- Description: Plays the system chime sound (Beep).
- Description: Plays the system chime sound (Beep) and waits sound to stop.
- Description: Plays the system chimes sound (Exclamation).
- Description: Plays the system chimes sound (Exclamation) and waits sound to stop.
- Description: Plays the system bell ring sound (Hand).
- Description: Plays the system bell ring sound (Hand) and waits for approximately 1 second.
- Description: Plays an audio file from the specified file path.
-
Parameters:
-
filePath
: The file path of the audio to play (supports local and network paths).
-
-
Returns:
true
if playback starts successfully,false
if an error occurs.
- Description: Plays an audio file from the specified file path and waits for the audio to finish playing.
-
Parameters:
-
filePath
: The file path of the audio to play (supports local and network paths).
-
-
Returns:
true
if playback completes successfully,false
if an error occurs.
- Description: Stops the playback of an audio file.
- Description: Pauses the playback of an audio file.
-
Returns:
true
if the pause is successful,false
if an error occurs.