-
Couldn't load subscription status.
- 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:ssformat. -
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:
trueif playback starts successfully,falseif 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:
trueif playback completes successfully,falseif an error occurs.
- Description: Stops the playback of an audio file.
- Description: Pauses the playback of an audio file.
-
Returns:
trueif the pause is successful,falseif an error occurs.