SoundPlayerControl 0.9.0.5

Sound Player Control for NAudio

There is a newer version of this package available.
See the version list below for details.
Install-Package SoundPlayerControl -Version 0.9.0.5
dotnet add package SoundPlayerControl --version 0.9.0.5
<PackageReference Include="SoundPlayerControl" Version="0.9.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SoundPlayerControl --version 0.9.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SoundPlayerControl, 0.9.0.5"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SoundPlayerControl as a Cake Addin
#addin nuget:?package=SoundPlayerControl&version=0.9.0.5

// Install SoundPlayerControl as a Cake Tool
#tool nuget:?package=SoundPlayerControl&version=0.9.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

This control can be used by dragging and dropping it onto a form, or programattically.
Uses Dot NET 4.8

Features:

  • Uses NAudio
  • Output sound to a selected sound device (not just the default)
  • Detects changes to audio outputs
  • Events to capture when playback and recording is stopped, and others
  • Hide / show controls on the player to suit your needs
  • Basic audio recording to a wav file
  • Drag and drop the control onto a form, and its ready to go for loading and playing a sound, and recording (no code required)
  • and more!

A very simple code based example
(Check the test code in GitHub for more examples)

SoundPlayer sp;

private void btnPlaySound_Click(object sender, EventArgs e)
{
...
sp = new SoundPlayer(@"C:\Windows\Media\Alarm01.wav", 95);
sp.PlaybackStopped += SoundPlayer_PlaybackStopped;
sp.PlaySound();
...
}

private void SoundPlayer_PlaybackStopped(object sender, NAudio.Wave.StoppedEventArgs e)
{
MessageBox.Show("Programmatic sound has finished playing");
sp.Dispose();
}

This control can be used by dragging and dropping it onto a form, or programattically.
Uses Dot NET 4.8

Features:

  • Uses NAudio
  • Output sound to a selected sound device (not just the default)
  • Detects changes to audio outputs
  • Events to capture when playback and recording is stopped, and others
  • Hide / show controls on the player to suit your needs
  • Basic audio recording to a wav file
  • Drag and drop the control onto a form, and its ready to go for loading and playing a sound, and recording (no code required)
  • and more!

A very simple code based example
(Check the test code in GitHub for more examples)

SoundPlayer sp;

private void btnPlaySound_Click(object sender, EventArgs e)
{
...
sp = new SoundPlayer(@"C:\Windows\Media\Alarm01.wav", 95);
sp.PlaybackStopped += SoundPlayer_PlaybackStopped;
sp.PlaySound();
...
}

private void SoundPlayer_PlaybackStopped(object sender, NAudio.Wave.StoppedEventArgs e)
{
MessageBox.Show("Programmatic sound has finished playing");
sp.Dispose();
}

Release Notes

* Improved tooltips - shows filename and play time
* Events added for changing the volume, and changing the device
* Added list of current devices - recording, and playback
* Added basic record function
* Event added for recording finished
* Disable load button on playing sound
* Message appears when recording
* Improved appearance of browse icon
* Error with volume level fixed (not going to full volume)
* Added properties for customising the width of the title, device list and the filename

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.9.0.6 548 8/11/2019
0.9.0.5 233 8/2/2019
0.9.0.4 229 7/28/2019
0.9.0.3 216 7/28/2019
0.9.0.2 224 7/27/2019
0.9.0.1 216 7/27/2019
0.9.0 222 7/27/2019