AudioEngine Constructor (String, TimeSpan, String)
Initializes a new instance of this class, using a settings file, a specific audio renderer, and a specific speaker configuration.
Syntax
'Declaration
Public Sub New ( _
settingsFile As String, _
lookAheadTime As TimeSpan, _
rendererId As String _
)
public AudioEngine (
string settingsFile,
TimeSpan lookAheadTime,
string rendererId
)
public:
AudioEngine(
String settingsFile,
TimeSpan lookAheadTime,
String rendererId
)
Parameters
- settingsFile
Type: String
Path to a global settings file. - lookAheadTime
Type: TimeSpan
Interactive audio and branch event look-ahead time, in milliseconds. - rendererId
Type: String
A string that specifies the audio renderer to use.
Exceptions
Exception type | Condition |
---|---|
ArgumentNullException | The settingsFile parameter is null. |
ArgumentException | XACT could not load the data provided. Make sure you are using the correct version of the XACT tool. |
InvalidOperationException | The engine could not be created. |
Remarks
The lookAheadTime parameter specifies how far ahead the audio engine will look when determining when to transition to another sound. For sounds linked to Play events that use a wave variation list, this parameter should be set to greater than 250 milliseconds. Doing so should give the audio engine enough time to prepare streamed data before it is needed for the loop iteration.
Requirements
Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
See Also
Reference
AudioEngine Class
AudioEngine Members
Microsoft.Xna.Framework.Audio Namespace
Platforms
Windows Phone