Sound Class

MSBuild Extension Pack

Sound Class MSBuild Extension Pack Help 4.0.12.0
Valid TaskActions are:

Play (Required: SoundFile or SystemSound Optional: Repeat, Interval)

Remote Execution Support: NA

Inheritance Hierarchy

SystemObject  Microsoft.Build.UtilitiesTask
    MSBuild.ExtensionPackBaseTask
      MSBuild.ExtensionPack.MultimediaSound

Namespace: MSBuild.ExtensionPack.Multimedia
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0

The Sound type exposes the following members.

Constructors

  NameDescription
Public methodSound
Top
Properties

  NameDescription
Public propertyInterval
Sets the interval between beebs. Default is 10ms. Value must be between 10 and 5000
Public propertyRepeat
Sets the number of times to play the sound. Default is 1. Value must be between 1 and 20
Public propertySoundFile
Sets the sound file to play
Public propertySystemSound
Sets the SystemSound to play. Supports: Asterisk, Beep, Exclamation, Hand, Question. Does not support Repeat or Interval.
Top
Examples

<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <Target Name="Default">
        <!-- Play a bunch of sounds with various tones, repeats and durations-->
        <MSBuild.ExtensionPack.Multimedia.Sound TaskAction="Play" SoundFile="C:\Windows\Media\notify.wav" Repeat="10"/>
        <MSBuild.ExtensionPack.Framework.Thread TaskAction="Sleep" Timeout="500"/>
        <MSBuild.ExtensionPack.Multimedia.Sound TaskAction="Play" SystemSound="Asterisk"/>
        <MSBuild.ExtensionPack.Framework.Thread TaskAction="Sleep" Timeout="500"/>
        <MSBuild.ExtensionPack.Multimedia.Sound TaskAction="Play" SystemSound="Beep"/>
        <MSBuild.ExtensionPack.Framework.Thread TaskAction="Sleep" Timeout="500"/>
        <MSBuild.ExtensionPack.Multimedia.Sound TaskAction="Play" SystemSound="Exclamation"/>
        <MSBuild.ExtensionPack.Framework.Thread TaskAction="Sleep" Timeout="500"/>
        <MSBuild.ExtensionPack.Multimedia.Sound TaskAction="Play" SystemSound="Hand"/>
        <MSBuild.ExtensionPack.Framework.Thread TaskAction="Sleep" Timeout="500"/>
        <MSBuild.ExtensionPack.Multimedia.Sound TaskAction="Play" SystemSound="Question"/>
    </Target>
</Project>
See Also

Reference