I want to set the Secondary Buffer capabilities Control Frequency and Control Volume to true. I can't access the capabilities directly through the BufferDescription class, so am using BufferDecriptionFlags, but this can only hold one flag.
public void initialize(Stream audioStream)
{
inputStream = new MemoryStream();
device = new DirectSound(SlimDX.DirectSound.DirectSoundGuid.DefaultPlaybackDevice);
waveFormat.FormatTag = SlimDX.Multimedia.WaveFormatTag.Pcm;
waveFormat.BitsPerSample = 16;
waveFormat.BlockAlignment = 2;
waveFormat.Channels = 1;
waveFormat.SamplesPerSecond = 16000;
waveFormat.AverageBytesPerSecond = 32000;
bufferDescription = new SlimDX.DirectSound.SoundBufferDescription();
bufferDescription.Format = waveFormat;
bufferDescription.Flags = BufferFlags.ControlFrequency;
bufferDescription.Flags = BufferFlags.ControlVolume;
bufferDescription.SizeInBytes = amountOfTimeToRecord * 2 * waveFormat.AverageBytesPerSecond;
this.audioStream = audioStream;
Ready = true;
}
in the above example, the control frequency is not accessible because the control volume is used instead. Because the BufferFlags object only holds one value. It seems that changing the boolean value of the buffer capabilities should be accessible but I can't seem to do it.