C# Класс NAudio.Wave.DirectSoundOut

NativeDirectSoundOut using DirectSound COM interop. Contact author: Alexandre Mutel - alexandre_mutel at yahoo.fr Modified by: Graham "Gee" Plumb
Наследование: IWavePlayer
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DSDEVID_DefaultCapture System.Guid
DSDEVID_DefaultPlayback System.Guid
DSDEVID_DefaultVoiceCapture System.Guid
DSDEVID_DefaultVoicePlayback System.Guid

Открытые методы

Метод Описание
DirectSoundOut ( ) : System

Initializes a new instance of the DirectSoundOut class.

DirectSoundOut ( System.Guid device ) : System

Initializes a new instance of the DirectSoundOut class.

DirectSoundOut ( System.Guid device, int latency ) : System

Initializes a new instance of the DirectSoundOut class. (40ms seems to work under Vista).

DirectSoundOut ( int latency ) : System

Initializes a new instance of the DirectSoundOut class.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetPosition ( ) : long

Gets the current position in bytes from the wave output device. (n.b. this is not the same thing as the position within your reader stream)

Init ( IWaveProvider waveProvider ) : void

Initialise playback

Pause ( ) : void

Pause Playback

Play ( ) : void

Begin playback

Stop ( ) : void

Stop playback

Приватные методы

Метод Описание
DirectSoundCreate ( System.Guid &GUID, [ directSound, IntPtr pUnkOuter ) : void
DirectSoundEnumerate ( DSEnumCallback lpDSEnumCallback, IntPtr lpContext ) : void
EnumCallback ( IntPtr lpGuid, IntPtr lpcstrDescription, IntPtr lpcstrModule, IntPtr lpContext ) : bool
Feed ( int bytesToCopy ) : int

Feeds the SecondaryBuffer with the WaveStream

GetDesktopWindow ( ) : IntPtr
InitializeDirectSound ( ) : void
IsBufferLost ( ) : bool

Determines whether the SecondaryBuffer is lost.

MsToBytes ( int ms ) : int

Convert ms to bytes size according to WaveFormat

PlaybackThreadFunc ( ) : void

Processes the samples in a separate thread.

RaisePlaybackStopped ( Exception e ) : void
StopPlayback ( ) : void

Stop playback

Описание методов

DirectSoundOut() публичный Метод

Initializes a new instance of the DirectSoundOut class.
public DirectSoundOut ( ) : System
Результат System

DirectSoundOut() публичный Метод

Initializes a new instance of the DirectSoundOut class.
public DirectSoundOut ( System.Guid device ) : System
device System.Guid
Результат System

DirectSoundOut() публичный Метод

Initializes a new instance of the DirectSoundOut class. (40ms seems to work under Vista).
public DirectSoundOut ( System.Guid device, int latency ) : System
device System.Guid Selected device
latency int The latency.
Результат System

DirectSoundOut() публичный Метод

Initializes a new instance of the DirectSoundOut class.
public DirectSoundOut ( int latency ) : System
latency int
Результат System

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

GetPosition() публичный Метод

Gets the current position in bytes from the wave output device. (n.b. this is not the same thing as the position within your reader stream)
public GetPosition ( ) : long
Результат long

Init() публичный Метод

Initialise playback
public Init ( IWaveProvider waveProvider ) : void
waveProvider IWaveProvider The waveprovider to be played
Результат void

Pause() публичный Метод

Pause Playback
public Pause ( ) : void
Результат void

Play() публичный Метод

Begin playback
public Play ( ) : void
Результат void

Stop() публичный Метод

Stop playback
public Stop ( ) : void
Результат void

Описание свойств

DSDEVID_DefaultCapture публичное статическое свойство

DirectSound default capture device GUID
public static Guid,System DSDEVID_DefaultCapture
Результат System.Guid

DSDEVID_DefaultPlayback публичное статическое свойство

DirectSound default playback device GUID
public static Guid,System DSDEVID_DefaultPlayback
Результат System.Guid

DSDEVID_DefaultVoiceCapture публичное статическое свойство

DirectSound default device for voice capture
public static Guid,System DSDEVID_DefaultVoiceCapture
Результат System.Guid

DSDEVID_DefaultVoicePlayback публичное статическое свойство

DirectSound default device for voice playback
public static Guid,System DSDEVID_DefaultVoicePlayback
Результат System.Guid