--- title: "system.vision.playSoundClip" description: "Plays a sound clip from a wav file to the system's default audio device." --- # system.vision.playSoundClip > Plays a sound clip from a wav file to the system's default audio device. :::info Backwards Compatibility This function replaces [system.util.playSoundClip](versioned_docs/version-8.1/appendix/scripting-functions/system-util/system-util-playSoundClip.md). Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. ::: This function is used in **Python Scripting**. ## Description Plays a sound clip from a .wav file to the system's default audio device. The .wav file can be specified as a filepath, a URL, or directly as a raw List[Byte]. ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax - Using a Byte List `system.vision.playSoundClip(wavBytes, [volume], [wait])` ### Parameters Type | Parameter | Description ------- | ------- | ------ List[Byte]| `wavBytes` | A byte list of a wav file. Float| `volume` | The clip's volume, represented as a floating point number between 0.0 and 1.0. [optional] Boolean | `wait` | A boolean flag indicating whether or not the call to playSoundClip should block further script execution within the triggering event until the clip finishes. Useful in cases where code on lines after the playSoundClip call should wait until the sound clip finishes playing. [optional] ### Returns Nothing ### Scope Vision Client ## Syntax - Using a Filepath or URL `system.vision.playSoundClip(wavFile [, volume] [, wait])` ### Parameters Type | Parameter | Description ------- | ------- | ------ String | `wavFile` | A filepath or URL that represents a wav file. Float| `volume` | The clip's volume, represented as a floating point number between 0.0 and 1.0. [optional] Boolean | `wait` | A boolean flag indicating whether or not the call to playSoundClip should block further script execution within the triggering event until the clip finishes. Useful in cases where code on lines after the playSoundClip call should wait until the sound clip finishes playing. [optional] ### Returns Nothing ### Scope Vision Client ## Code Examples ```python title="Example #1" # This code would play a sound clip at full volume that was located on the current # host's filesystem. It will not return until the clip in finished playing. system.vision.playSoundClip("C:\\sounds\\siren.wav") ``` ```python title="Example #2" # This code pulls a sound clip out of a BLOB field from a database # and plays it asynchronously at half volume. query = "SELECT wavBlob FROM sounds WHERE type = ?" soundData = system.db.runScalarPrepQuery(query, ["alert_high"]) system.vision.playSoundClip(soundData, 0.5, 0) ```