I have a C # application that plays simple wav files through directsound. With the test data that I had, the code worked fine. However, when I used real-world data, it created a very useless error when creating a secondary buffer: "ArgumentException: value does not fall into the expected range."
The wavs test had a data transfer rate of 512 kbps, a sample size of 16 bits and a sampling frequency of 32 kHz. The new wavs are 1152 kbit / s, 24 bit and 48 kHz respectively. How can I get directsound to handle these larger values, or if not, how can I programmatically determine these values ββbefore trying to play the file?
it was running DirectX v9.00.1126 I am using and I have included the sample code below:
using DS = Microsoft.DirectX.DirectSound;
...
DS.Device device = new DS.Device();
device.SetCooperativeLevel(this, CooperativeLevel.Normal);
...
BufferDescription bufferDesc = new BufferDescription();
bufferDesc.ControlEffects = false;
...
try
{
SecondaryBuffer sound = new SecondaryBuffer(path, bufferDesc, device);
sound.Play(0, BufferPlayFlags.Default);
}
...
Additional information: real-world wav files will not play in Windows Media Player, telling me that a codec is required to play the file, while they play winamp perfectly.
2: , , RIFF "bext", , , , fmt. / fmt chunk , , fmt. , beuge beuge , - , .