Play Sound From Folder

Play a random audio file from a folder
Play Sound From Folder Dialog
Play Sound From Folder Dialog

Parameters

Audio Device
Select required
Default:
Application Default

Select an audio device to use for output

Application Default will use the device configured in the Settings tab in Streamer.bot

Folder containing...
Folder required

Select the folder containing the audio files for playback.

Click ... to open a file browser.

Supported formats: mp3, wav

Finish playing before continuing
Toggle
Default:
true

Wait for playback to complete before continuing to the next sub-action.

When disabled, the sound will play immediately and the next sub-action will begin to execute with no delay.

Recursive
Toggle

Include all subdirectories within the selected folder

Volume
Range
Default:
100

Adjust the output volume

This is a simple volume control. It can often be useful to instead adjust the volume with a tool like Audacity.

Sound Name
string
Use Filename As Name
Toggle

Enabling this will use the filename of the sound as the sound name

Variables

NameTypeDescription
Example Value:C:\ScaryNoises\chad.mp3

Full path of the audio file that was randomly selected for playback

Example Value:chad.mp3

File name of the audio file that was randomly selected for playback

Length of chosen sound in seconds.

Length of chosen sound in milliseconds.

C# Usage

public double PlaySoundFromFolder(string path, Single volume = 1, bool recursive = false, bool finishBeforeContinuing = false, string name, bool useFileName = true)