C# Class LitDev.LDSound

Show file Open project: litdev1/LitDev Class Usage Examples

Public Methods

Method Description
Asterisk ( ) : void

Play system Asterisk sound.

Beep ( ) : void

Play system Beep sound.

Exclamation ( ) : void

Play system Exclamation sound.

Hand ( ) : void

Play system Hand sound.

MusicPlayTime ( Primitive fileName ) : Primitive

Gets the play time for a music file.

Pause ( ) : void

Pause a recording.

Question ( ) : void

Play system Question sound.

Resume ( ) : void

Resume a paused recording.

Start ( ) : void

Start recording sound.

Stop ( Primitive wavFile ) : Primitive

Stop and save current sound recording.

Tone ( Primitive frequency, Primitive duration ) : void

Play a system tone sound with frequency and duration. Uses the motherboard speaker (not the sound card) and may be low quality or not available.

Private Methods

Method Description
Beep ( uint dwFreq, uint dwDuration ) : bool
mciSendString ( string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback ) : int

Method Details

Asterisk() public static method

Play system Asterisk sound.
public static Asterisk ( ) : void
return void

Beep() public static method

Play system Beep sound.
public static Beep ( ) : void
return void

Exclamation() public static method

Play system Exclamation sound.
public static Exclamation ( ) : void
return void

Hand() public static method

Play system Hand sound.
public static Hand ( ) : void
return void

MusicPlayTime() public static method

Gets the play time for a music file.
public static MusicPlayTime ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the music file e.g. "C:\Users\Public\Music\song.mp3". ///
return Primitive

Pause() public static method

Pause a recording.
public static Pause ( ) : void
return void

Question() public static method

Play system Question sound.
public static Question ( ) : void
return void

Resume() public static method

Resume a paused recording.
public static Resume ( ) : void
return void

Start() public static method

Start recording sound.
public static Start ( ) : void
return void

Stop() public static method

Stop and save current sound recording.
public static Stop ( Primitive wavFile ) : Primitive
wavFile Primitive The full path to a wav file to save the recording. /// The extension will be set to ".wav" if it is not already.
return Primitive

Tone() public static method

Play a system tone sound with frequency and duration. Uses the motherboard speaker (not the sound card) and may be low quality or not available.
public static Tone ( Primitive frequency, Primitive duration ) : void
frequency Primitive The tone frequency (from 37 to 32767 Hz).
duration Primitive The tone duration in ms.
return void