< Back

New-BTAudio

Sun Jan 12, 2020 7:28 pm

NAME New-BTAudio



SYNOPSIS

Creates a new Audio object for Toast Notifications.





SYNTAX

New-BTAudio -Source <Uri> [-Loop] [-WhatIf] [-Confirm] [<CommonParameters>]



New-BTAudio -Path <String> [-Loop] [-WhatIf] [-Confirm] [<CommonParameters>]



New-BTAudio -Silent [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

The New-BTAudio function creates a new Audio object for Toast Notifications.



You can use the parameters of New-BTAudio to select an audio file or a standard notification sound (including

alarms). Alternativly you can specify that a Toast Notification should be silent.





PARAMETERS

-Source <Uri>

Specifies one of the built in Microsoft notification sounds.



This paramater takes the full form of the sounds, in the form of a uri. The New-BurntToastNotification

function simplifies this, so be aware of the difference.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

The full path to an audio file. Supported file types include:



*.aac

*.flac

*.m4a

*.mp3

*.wav

*.wma



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Loop [<SwitchParameter>]

Specifies that the slected sound should play multiple times if its duration is shorter than that of the toast

it accompanies.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Silent [<SwitchParameter>]

Specifies that the toast should be displayed without sound.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None



You cannot pipe input to this cmdlet.





OUTPUTS

Microsoft.Toolkit.Uwp.Notifications.ToastAudio





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-BTAudio -Source ms-winsoundevent:Notification.SMS



Creates an Audio which will cause a Toast Notification to play the standard Microsoft 'SMS' sound.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-BTAudio -Path 'C:\\Music\\FavSong.mp3'



Creates an Audio which will cause a Toast Notification to play the specified song.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>New-BTAudio -Silent



Creates an Audio which will cause a Toast Notification to be silent.











RELATED LINKS

https://github.com/Windos/BurntToast/bl ... BTAudio.md