Skip to content

Commit

Permalink
(breaking) Remove custom audio path
Browse files Browse the repository at this point in the history
The ability to point to your own sound files was removed by Microsoft
several years ago and has been deprecated in BurntToast for almost as
long. This means only built in system sounds can be used now.
  • Loading branch information
Windos committed Apr 26, 2024
1 parent 4046dcc commit 5c9b8f6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 56 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

- Breaking Change: Shoulder tap notification support has been removed

- Breaking Change: Custom audio source support has been removed

- Libraries: Microsoft.Windows.SDK.NET.Ref library bumped to 10.0.22621.28

- Libraries: Microsoft.Toolkit.Uwp.Notifications library bumped to 7.1.3
Expand Down
10 changes: 0 additions & 10 deletions Tests/New-BTAudio.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,4 @@ Describe 'New-BTAudio' {
$Log | Should -Be $Expected
}
}

Context 'input validation' {
It 'throws if audio file doesn''t exist' {
{ New-BTAudio -Path 'C:\Fake\phantom.wav' } | Should -Throw "Cannot validate argument on parameter 'Path'. The file 'C:\Fake\phantom.wav' doesn't exist in the specified location. Please provide a valid path and try again."
}

It 'throws if the extension is not supported' {
{ New-BTAudio -Path 'C:\Fake\phantom.mov' } | Should -Throw "Cannot validate argument on parameter 'Path'. The file extension '.mov' is not supported. Please provide a valid path and try again."
}
}
}
27 changes: 0 additions & 27 deletions src/Private/Test-BTAudioPath.ps1

This file was deleted.

19 changes: 0 additions & 19 deletions src/Public/New-BTAudio.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,7 @@
'ms-winsoundevent:Notification.Looping.Call10')]
[uri] $Source,

# The full path to an audio file. Supported file types include:
#
# *.aac
# *.flac
# *.m4a
# *.mp3
# *.wav
# *.wma
[Parameter(Mandatory,
ParameterSetName = 'CustomSound')]
[ValidateScript({Test-BTAudioPath $_})]
[Obsolete('Unfortunately, custom sounds no longer work and this parameter will be removed in v0.9.0. See: https://github.com/MicrosoftDocs/windows-uwp/issues/1593')]
[string] $Path,

# Specifies that the slected sound should play multiple times if its duration is shorter than that of the toast it accompanies.
[Parameter(ParameterSetName = 'CustomSound')]
[Parameter(ParameterSetName = 'StandardSound')]
[switch] $Loop,

Expand All @@ -103,10 +88,6 @@
$Audio.Src = $Source
}

if ($Path) {
$Audio.Src = $Path
}

$Audio.Loop = $Loop
$Audio.Silent = $Silent

Expand Down

0 comments on commit 5c9b8f6

Please sign in to comment.