Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "sound" in [All]

kernel32

.

    Sound                = 0x0000001d,

Constants

.

    public static readonly Guid GUID_DEVCLASS_SOUND = new Guid("{0x4d36e97c, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}}");

.

    public static PropertyKey PKEY_Device_NoConnectSound = new PropertyKey(0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 17);     // DEVPROP_TYPE_BOOLEAN

.

    public static PropertyKey PKEY_Photo_RelatedSoundFile = new PropertyKey( 0x318A6B45, 0x087F, 0x4DC2, 0xB8, 0xCC, 0x05, 0x35, 0x95, 0x51, 0xFC, 0x9E, 100);

.

    public const int SHERB_NOSOUND    = 0x00000004;

.

    public const int NIIF_NOSOUND   = 0x00000010;

.

    public const int SHERB_NOSOUND    = 0x00000004;

.

    public const int NIIF_NOSOUND   = 0x00000010;

user32

.
Summary
Plays a waveform sound.
.

System.Media.SystemSounds._.Play

.

const uint EVENT_SYSTEM_SOUND = 0x0001;

.

static extern TODO sounds(TODO);

.

Declare Function sounds Lib "user32.dll" (TODO) As TODO

.
Documentation
[sounds] on MSDN

shell32

.

        //     No sound will be played when the operation is complete.

.

        const int SHERB_NOSOUND = 0x00000004;

.

                    SHERB_NOCONFIRMATION | SHERB_NOPROGRESSUI | SHERB_NOSOUND);

Enums

.

    FILE_DEVICE_SOUND = 0x1d,

.

    FILE_DEVICE_SOUND = &H1d

.

        FEATURE_DISABLE_NAVIGATION_SOUNDS = 21,

.

        SM_SHOWSOUNDS = 70,

.

    SM_SHOWSOUNDS          = 70, // 0x46

.

    SM_SHOWSOUNDS       = 70

.

    SM_SHOWSOUNDS = 70

winmm

.
Summary
Plays a PCM sound file from a filename, resource name or registry alias
.

static extern bool PlaySound(string pszSound, UIntPtr hmod, uint fdwSound);

.

static extern bool PlaySound(byte[] pszSound, IntPtr hmod, SoundFlags fdwSound);

.

Shared Function PlaySound( _

.

   ByVal szSound As String, _

.

   ByVal fdwSound As Integer) As Integer

.

Public Declare Auto Function PlaySound Lib "winmm.dll" (ByVal pszSound As String, ByVal hmod As IntPtr, ByVal fdwSound As Integer) As Boolean

.

Public Declare Auto Function PlaySound Lib "winmm.dll" (ByVal pszSound As Byte(), ByVal hmod As IntPtr, ByVal fdwSound As SoundFlags) As Boolean

.

You will need these flags for the fdwSound parameter

.

public enum SoundFlags

.

    /// <summary>silence (!default) if sound not found</summary>

.

    /// <summary>pszSound points to a memory file</summary>

.

    /// <summary>loop the sound until next sndPlaySound</summary>

.

    /// <summary>don't stop any currently playing sound</summary>

.

    /// <summary>The pszSound parameter is an application-specific alias in the registry. You can combine this flag with the SND_ALIAS or SND_ALIAS_ID flag to specify an application-defined sound alias.</summary>

.

    Public Enum SoundFlags As Integer

.

    ''' The sound is played synchronously, and PlaySound returns after

.

    ''' the sound event completes. This is the default behavior.

.

    ''' The sound is played asynchronously and PlaySound returns

.

    ''' immediately after beginning the sound. To terminate an

.

    ''' asynchronously played waveform sound, call PlaySound with

.

    ''' pszSound set to NULL.

.

    ''' No default sound event is used. If the sound cannot be found,

.

    ''' PlaySound returns silently without playing the default sound.

.

    ''' The pszSound parameter points to a sound loaded in memory.

.

    ''' The sound plays repeatedly until PlaySound is called again

.

    ''' with the pszSound parameter set to NULL. If this flag is

.

    ''' The specified sound event will yield to another sound event

.

    ''' that is already playing. If a sound cannot be played because

.

    ''' the resource needed to generate that sound is busy playing

.

    ''' another sound, the function immediately returns False without

.

    ''' playing the requested sound.

.

    ''' <remarks>If this flag is not specified, PlaySound attempts

.

    ''' to stop the currently playing sound so that the device can

.

    ''' be used to play the new sound.

.

    ''' The pszSound parameter is an application-specific alias in

.

    ''' or SND_ALIAS_ID flag to specify an application-defined sound

.

    ''' the sound.

.

    ''' The pszSound parameter is a system-event alias in the

.

    ''' The pszSound parameter is a file name. If the file cannot be

.

    ''' found, the function plays the default sound unless the

.

    ''' The pszSound parameter is a resource identifier; hmod must

.

To play a sound looping both SND_LOOP and SND_ASYNC flags have to be specified. Looped sounds only stop when PlaySound is called with pszSound set to NULL.

.

    PlaySound (strFileName, UIntPtr.Zero, (uint)(SoundFlags.SND_FILENAME | SoundFlags.SND_ASYNC));

.

public static void Play (byte[] waveData) //bad idea, see http://blogs.msdn.com/larryosterman/archive/2009/02/19/playsound-xxx-snd-memory-snd-async-is-almost-always-a-bad-idea.aspx

.

    PlaySound (waveData, IntPtr.Zero, PlayFlags.SND_ASYNC | PlayFlags.SND_MEMORY);

.

     bool result = PlaySound(@"C:\path\to\wav\file.wav" ,ip ,0);

.

     PlaySound(strFileName, IntPtr.Zero, SoundFlags.SND_FILENAME Or SoundFlags.SND_ASYNC)

.

Public Shared Sub Play(ByVal waveData As Byte()) //bad idea, see http://blogs.msdn.com/larryosterman/archive/2009/02/19/playsound-xxx-snd-memory-snd-async-is-almost-always-a-bad-idea.aspx

.

     PlaySound(waveData, IntPtr.Zero, SoundFlags.SND_ASYNC Or SoundFlags.SND_MEMORY)

.

     Dim result As Boolean = PlaySound("C:\path\to\wav\file.wav", IntPtr.Zero, ip)

.

In .Net 2.0 you can use the System.Media.SoundPlayer class instead:

.

SoundPlayer sound = new SoundPlayer(@"C:\Windows\Media\tada.wav");

.

sound.Load(); // can also be called asychronously i.e. LoadAsync()

.

sound.Play(); // default is to play asyncronously

.

Or you can play a system specific sound:

.

My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Asterisk)

.
Documentation
[PlaySound] on MSDN

coredll

.

http://stackoverflow.com/questions/982934/how-do-you-disable-the-key-click-sound-in-windows-ce

.
Summary
This function marks as "handled" all notifications previously registered by the given application that have occurred. CeHandleAppNotifications turns off the sound and LED and stops vibration (if they were on), and removes the taskbar annunciator.
.

    public string Sound;

.

    public UInt32 MaxSound;

.
Summary
Plays a sound
.

    public static extern int PlaySound(

.

        string szSound,

.

    Public Shared Function PlaySound( _

.

        ByVal szSound As String, _

.

    public static extern int PlaySound(

.

        byte[] szSound,

.

    Public Shared Function PlaySound( _

.

        ByVal szSound() As Byte, _

.

Private Declare Function PlaySound Lib "coredll" Alias "PlaySoundW" (ByVal szSound As String, ByVal hModule As IntPtr, ByVal flags As PlaySoundFlags) As Boolean

.

Private Declare Function PlaySound Lib "coredll" (ByVal szSound As Byte(), ByVal hModule As IntPtr, ByVal flags As PlaySoundFlags) As Boolean

.

VB PlaySoundFlags Enumeration:

.

    Private Enum PlaySoundFlags As UInt32

.

        SND_NODEFAULT = &H2          ' silence (!default) if sound not found

.

        SND_MEMORY = &H4              ' pszSound points to a memory file

.

        SND_LOOP = &H8              ' loop the sound until next sndPlaySound

.

        SND_NOSTOP = &H10              ' don't stop any currently playing sound

.

C# PlaySoundFlags Enumeration:

.

    public enum PlaySoundFlags : uint {

.

        SND_NODEFAULT = 0x2,        // silence (!default) if sound not found

.

        SND_MEMORY = 0x4,            // pszSound points to a memory file

.

        SND_LOOP = 0x8,            // loop the sound until next sndPlaySound

.

        SND_NOSTOP = 0x10,            // don't stop any currently playing sound

.

If the function returns True but there is no sound, check Settings / Sounds & Notifications / Enable sounds for / Programs / Notifications

.

    namespace Sound

.

        public enum PlaySoundFlags : int {

.

            SND_NODEFAULT = 0x2,    // silence (!default) if sound not found

.

            SND_MEMORY = 0x4,       // pszSound points to a memory file

.

            SND_LOOP = 0x8,     // loop the sound until next sndPlaySound

.

            SND_NOSTOP = 0x10,      // don't stop any currently playing sound

.

        public class Sound

.

            public static extern int PlaySound(

.

                string szSound,

.

                    PlaySound(fileName, IntPtr.Zero, (PlaySoundFlags.SND_FILENAME | PlaySoundFlags.SND_SYNC));

.

                    MessageBox.Show("Can't play sound file. " + ex.ToString());

.

    Public Class Sounds

.

        Private Enum PlaySoundFlags

.

            SND_NODEFAULT = &H2          ' silence (!default) if sound not found

.

            SND_MEMORY = &H4          ' pszSound points to a memory file

.

            SND_LOOP = &H8          ' loop the sound until next sndPlaySound

.

            SND_NOSTOP = &H10          ' don't stop any currently playing sound

.

     Public Shared Function PlaySound( _

.

      ByVal szSound As String, _

.

                PlaySound(fileName, IntPtr.Zero, PlaySoundFlags.SND_FILENAME Or _

.

                  PlaySoundFlags.SND_SYNC)

.

                MessageBox.Show("Can't play sound file. " & ex.ToString)

.
Documentation
[PlaySound] on MSDN

Structures

.

     QSOUNDPAN      =(SLIDER + 2),

.

   POWER_LEVEL_USER_NOTIFY_SOUND = 0x00000002, // User notified using sound.

.

   POWER_LEVEL_USER_NOTIFY_SOUND = &H2    ' User notified using sound.

.

    WAVECAPS_DIRECTSOUND = &H40

aygshell

.

Gets the current sound that will be played when an event happens (ie. a phone call)

.

Private Shared Function SndGetSound(ByVal seSoundEvent as SoundEvent, ByRef pSoundFileInfo as SNDFILEINFO) as UInteger

.

  Public sstType as SoundType

.

  Public Enum SoundEvent

.

  Enum SoundType

.

  Dim MyCurrentSound as SoundType

.

  SndGetSound(SoundEvent.All, sfi)

.

  MyCurrentSound = sfi.sstType

.
Summary
Sets Sound Events
.

static extern uint SndSetSound(SND_EVENT soundEvent, SNDFILEINFO soundFileInfo, bool suppressUI);

.

Private Shared Function SndSetSound(ByVal seSoundEvent as SoundEvent, ByRef pSoundFileInfo as SNDFILEINFO, ByVal fSuppressUI as Boolean) as UInteger

.

Public Enum SoundEvent

.

Enum SoundType

.

Public sstType as SoundType

.

sfi.sstType = SoundType.Vibrate

.

SndSetSound(SoundEvent.All, sfi, True)

oleacc

.

        SOUND = 0xFFFFFFF5,


 
Access PInvoke.net directly from VS: