AudioContext Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AudioContext() |
Runs before the actual class constructor, to load available devices. |
| AudioContext(String) |
Constructs a new AudioContext instance. |
| AudioContext(String, Int32) |
Constructs a new AudioContext, using the specified audio device and device parameters. |
| AudioContext(String, Int32, Int32) |
Constructs a new AudioContext, using the specified audio device and device parameters. |
| AudioContext(String, Int32, Int32, Boolean) |
Constructs a new AudioContext, using the specified audio device and device parameters. |
| AudioContext(String, Int32, Int32, Boolean, Boolean) |
Creates the audio context using the specified device and device parameters. |
| AudioContext(String, Int32, Int32, Boolean, Boolean, AudioContext+MaxAuxiliarySends) |
AudioContext()
Runs before the actual class constructor, to load available devices.
public AudioContext();
Applies to
AudioContext(String)
Constructs a new AudioContext instance.
public AudioContext(string device);
new OpenTK.Audio.AudioContext : string -> OpenTK.Audio.AudioContext
Parameters
- device
- String
The device name that will host this instance.
Applies to
AudioContext(String, Int32)
Constructs a new AudioContext, using the specified audio device and device parameters.
public AudioContext(string device, int freq);
new OpenTK.Audio.AudioContext : string * int -> OpenTK.Audio.AudioContext
Parameters
- device
- String
The name of the audio device to use.
- freq
- Int32
Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.
Remarks
Use AudioContext.AvailableDevices to obtain a list of all available audio devices. devices.
Applies to
AudioContext(String, Int32, Int32)
Constructs a new AudioContext, using the specified audio device and device parameters.
public AudioContext(string device, int freq, int refresh);
new OpenTK.Audio.AudioContext : string * int * int -> OpenTK.Audio.AudioContext
Parameters
- device
- String
The name of the audio device to use.
- freq
- Int32
Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.
- refresh
- Int32
Refresh intervals, in units of Hz. Pass 0 for driver default.
Remarks
Use AudioContext.AvailableDevices to obtain a list of all available audio devices. devices.
Applies to
AudioContext(String, Int32, Int32, Boolean)
Constructs a new AudioContext, using the specified audio device and device parameters.
public AudioContext(string device, int freq, int refresh, bool sync);
new OpenTK.Audio.AudioContext : string * int * int * bool -> OpenTK.Audio.AudioContext
Parameters
- device
- String
The name of the audio device to use.
- freq
- Int32
Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.
- refresh
- Int32
Refresh intervals, in units of Hz. Pass 0 for driver default.
- sync
- Boolean
Flag, indicating a synchronous context.
Remarks
Use AudioContext.AvailableDevices to obtain a list of all available audio devices. devices.
Applies to
AudioContext(String, Int32, Int32, Boolean, Boolean)
Creates the audio context using the specified device and device parameters.
public AudioContext(string device, int freq, int refresh, bool sync, bool enableEfx);
new OpenTK.Audio.AudioContext : string * int * int * bool * bool -> OpenTK.Audio.AudioContext
Parameters
- device
- String
The device descriptor obtained through AudioContext.AvailableDevices.
- freq
- Int32
Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.
- refresh
- Int32
Refresh intervals, in units of Hz. Pass 0 for driver default.
- sync
- Boolean
Flag, indicating a synchronous context.
- enableEfx
- Boolean
Indicates whether the EFX extension should be initialized, if present.
Exceptions
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.
Remarks
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.
Applies to
AudioContext(String, Int32, Int32, Boolean, Boolean, AudioContext+MaxAuxiliarySends)
public AudioContext(string device, int freq, int refresh, bool sync, bool enableEfx, OpenTK.Audio.AudioContext.MaxAuxiliarySends efxMaxAuxSends);
new OpenTK.Audio.AudioContext : string * int * int * bool * bool * OpenTK.Audio.AudioContext.MaxAuxiliarySends -> OpenTK.Audio.AudioContext
Parameters
- device
- String
- freq
- Int32
- refresh
- Int32
- sync
- Boolean
- enableEfx
- Boolean
- efxMaxAuxSends
- AudioContext.MaxAuxiliarySends