C# 클래스 OpenTK.Audio.AudioContext

Provides methods to instantiate, use and destroy an audio context for playback. Static methods are provided to list available devices known by the driver.
상속: IDisposable
파일 보기 프로젝트 열기: hultqvist/opentk 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AudioContext System
CreateContext void
Dispose void
MakeCurrent void

공개 메소드들

메소드 설명
AudioContext ( string device ) : System

Constructs a new AudioContext instance.

AudioContext ( string device, int freq ) : System

Constructs a new AudioContext, using the specified audio device and device parameters.

Use AudioContext.AvailableDevices to obtain a list of all available audio devices. devices.

AudioContext ( string device, int freq, int refresh ) : System

Constructs a new AudioContext, using the specified audio device and device parameters.

Use AudioContext.AvailableDevices to obtain a list of all available audio devices. devices.

AudioContext ( string device, int freq, int refresh, bool sync ) : System

Constructs a new AudioContext, using the specified audio device and device parameters.

Use AudioContext.AvailableDevices to obtain a list of all available audio devices. devices.

AudioContext ( string device, int freq, int refresh, bool sync, bool enableEfx ) : System

Creates the audio context using the specified device and device parameters.

For maximum compatibility, you are strongly recommended to use the default constructor.

Multiple AudioContexts are not supported at this point.

The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends. Values higher than supported will be clamped by the driver.

AudioContext ( string device, int freq, int refresh, bool sync, bool enableEfx, MaxAuxiliarySends efxMaxAuxSends ) : System

Creates the audio context using the specified device and device parameters.

For maximum compatibility, you are strongly recommended to use the default constructor.

Multiple AudioContexts are not supported at this point.

The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends. Values higher than supported will be clamped by the driver.

CheckErrors ( ) : void

Checks for ALC error conditions.

Dispose ( ) : void

Disposes of the AudioContext, cleaning up all resources consumed by it.

Equals ( object obj ) : bool

Compares this instance with another.

GetHashCode ( ) : int

Calculates the hash code for this instance.

MakeCurrent ( ) : void

Makes the AudioContext current in the calling thread.

Only one AudioContext can be current in the application at any time, regardless of the number of threads.

Process ( ) : void

Processes queued audio events.

If AudioContext.IsSynchronized is true, this function will resume the internal audio processing thread. If AudioContext.IsSynchronized is false, you will need to call this function multiple times per second to process audio events.

In some implementations this function may have no effect.

SupportsExtension ( string extension ) : bool

Checks whether the specified OpenAL extension is supported.

Suspend ( ) : void

Suspends processing of audio events.

To avoid audio artifacts when calling this function, set audio gain to zero before suspending an AudioContext.

In some implementations, it can be faster to suspend processing before changing AudioContext state.

In some implementations this function may have no effect.

ToString ( ) : string

Returns a System.String that desrcibes this instance.

비공개 메소드들

메소드 설명
AudioContext ( ) : System

Runs before the actual class constructor, to load available devices.

CreateContext ( string device, int freq, int refresh, bool sync, bool enableEfx, MaxAuxiliarySends efxAuxiliarySends ) : void

Creates the audio context using the specified device.

For maximum compatibility, you are strongly recommended to use the default constructor.

Multiple AudioContexts are not supported at this point.

The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends. Values higher than supported will be clamped by the driver.

Dispose ( bool manual ) : void
MakeCurrent ( AudioContext context ) : void

Makes the specified AudioContext current in the calling thread.

메소드 상세

AudioContext() 공개 메소드

Constructs a new AudioContext instance.
public AudioContext ( string device ) : System
device string The device name that will host this instance.
리턴 System

AudioContext() 공개 메소드

Constructs a new AudioContext, using the specified audio device and device parameters.
Use AudioContext.AvailableDevices to obtain a list of all available audio devices. devices.
public AudioContext ( string device, int freq ) : System
device string The name of the audio device to use.
freq int Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.
리턴 System

AudioContext() 공개 메소드

Constructs a new AudioContext, using the specified audio device and device parameters.
Use AudioContext.AvailableDevices to obtain a list of all available audio devices. devices.
public AudioContext ( string device, int freq, int refresh ) : System
device string The name of the audio device to use.
freq int Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.
refresh int Refresh intervals, in units of Hz. Pass 0 for driver default.
리턴 System

AudioContext() 공개 메소드

Constructs a new AudioContext, using the specified audio device and device parameters.
Use AudioContext.AvailableDevices to obtain a list of all available audio devices. devices.
public AudioContext ( string device, int freq, int refresh, bool sync ) : System
device string The name of the audio device to use.
freq int Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.
refresh int Refresh intervals, in units of Hz. Pass 0 for driver default.
sync bool Flag, indicating a synchronous context.
리턴 System

AudioContext() 공개 메소드

Creates the audio context using the specified device and device parameters.

For maximum compatibility, you are strongly recommended to use the default constructor.

Multiple AudioContexts are not supported at this point.

The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends. Values higher than supported will be clamped by the driver.

Occurs when the device string is invalid. Occurs when a specified parameter is invalid. /// Occurs when the specified device is not available, or is in use by another program. /// /// Occurs when an audio context could not be created with the specified parameters. /// /// Occurs when an AudioContext already exists.
public AudioContext ( string device, int freq, int refresh, bool sync, bool enableEfx ) : System
device string The device descriptor obtained through AudioContext.AvailableDevices.
freq int Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.
refresh int Refresh intervals, in units of Hz. Pass 0 for driver default.
sync bool Flag, indicating a synchronous context.
enableEfx bool Indicates whether the EFX extension should be initialized, if present.
리턴 System

AudioContext() 공개 메소드

Creates the audio context using the specified device and device parameters.

For maximum compatibility, you are strongly recommended to use the default constructor.

Multiple AudioContexts are not supported at this point.

The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends. Values higher than supported will be clamped by the driver.

Occurs when the device string is invalid. Occurs when a specified parameter is invalid. /// Occurs when the specified device is not available, or is in use by another program. /// /// Occurs when an audio context could not be created with the specified parameters. /// /// Occurs when an AudioContext already exists.
public AudioContext ( string device, int freq, int refresh, bool sync, bool enableEfx, MaxAuxiliarySends efxMaxAuxSends ) : System
device string The device descriptor obtained through AudioContext.AvailableDevices.
freq int Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.
refresh int Refresh intervals, in units of Hz. Pass 0 for driver default.
sync bool Flag, indicating a synchronous context.
enableEfx bool Indicates whether the EFX extension should be initialized, if present.
efxMaxAuxSends MaxAuxiliarySends Requires EFX enabled. The number of desired Auxiliary Sends per source.
리턴 System

CheckErrors() 공개 메소드

Checks for ALC error conditions.
Raised when an out of memory error is detected. Raised when an invalid value is detected. Raised when an invalid device is detected. Raised when an invalid context is detected.
public CheckErrors ( ) : void
리턴 void

Dispose() 공개 메소드

Disposes of the AudioContext, cleaning up all resources consumed by it.
public Dispose ( ) : void
리턴 void

Equals() 공개 메소드

Compares this instance with another.
public Equals ( object obj ) : bool
obj object The instance to compare to.
리턴 bool

GetHashCode() 공개 메소드

Calculates the hash code for this instance.
public GetHashCode ( ) : int
리턴 int

MakeCurrent() 공개 메소드

Makes the AudioContext current in the calling thread.
Only one AudioContext can be current in the application at any time, regardless of the number of threads.
/// Occurs if this function is called after the AudioContext has been disposed. /// /// Occurs when the AudioContext could not be made current. ///
public MakeCurrent ( ) : void
리턴 void

Process() 공개 메소드

Processes queued audio events.

If AudioContext.IsSynchronized is true, this function will resume the internal audio processing thread. If AudioContext.IsSynchronized is false, you will need to call this function multiple times per second to process audio events.

In some implementations this function may have no effect.

Occurs when this function is called after the AudioContext had been disposed.
public Process ( ) : void
리턴 void

SupportsExtension() 공개 메소드

Checks whether the specified OpenAL extension is supported.
public SupportsExtension ( string extension ) : bool
extension string The name of the extension to check (e.g. "ALC_EXT_EFX").
리턴 bool

Suspend() 공개 메소드

Suspends processing of audio events.

To avoid audio artifacts when calling this function, set audio gain to zero before suspending an AudioContext.

In some implementations, it can be faster to suspend processing before changing AudioContext state.

In some implementations this function may have no effect.

Occurs when this function is called after the AudioContext had been disposed.
public Suspend ( ) : void
리턴 void

ToString() 공개 메소드

Returns a System.String that desrcibes this instance.
public ToString ( ) : string
리턴 string