Buffer.Buffer(String,BufferDescription,Device) Constructor (Microsoft.DirectX.DirectSound)
Initializes a new instance of the Buffer class.
Definition
Visual Basic Public Sub New( _
ByVal fileName As String, _
ByVal desc As BufferDescription, _
ByVal parent As Device _
)C# public Buffer(
string fileName,
BufferDescription desc,
Device parent
);C++ public:
Buffer(
String^ fileName,
BufferDescription^ desc,
Device^ parent
);JScript public function Buffer(
fileName : String,
desc : BufferDescription,
parent : Device
);
Parameters
fileName System.String
A String that represents the file name of the file that contains source data for the buffer.desc Microsoft.DirectX.DirectSound.BufferDescription
A BufferDescription object that describes the buffer to create.parent Microsoft.DirectX.DirectSound.Device
A Device object that represents the parent device to use with the buffer.
Remarks
**Note: **If the method succeeds, check the Buffer.NotVirtualized property to determine whether a requested 3-D algorithm was available and stereo panning was substituted.
Microsoft DirectSound does not initialize the contents of the buffer, and the application cannot assume that it contains silence.
If an attempt is made to create a buffer with BufferCaps.LocateInHardware set to true on a system where hardware acceleration is not available, the method fails throwing either ControlUnavailableException or InvalidCallException, depending upon the operating system.
Exceptions
The request failed because resources, such as a priority level, were already in use by another caller.
An invalid parameter was passed to the called method.
One or more of the parameters is null.
The specified wave format is not supported.
The buffer size is not large enough to enable effects processing.
The buffer control (volume, pan, and so on) requested by the caller is not available. Controls must be specified when the buffer is created.
The method call is invalid for the current state of this object.
The object does not support aggregation.
DirectSound could not allocate sufficient memory to complete the call.
The function called is not supported at this time.