[.net] Capturing sound

Started by
1 comment, last by Telamon 18 years ago
Hi I'm trying to capture sound with directX 9.0 using C#. But I'm having trouble with creating the CaptureBuffer.

if (m_wave.Channels == 0)
				return;
			m_notifySize = (1024 > m_wave.AverageBytesPerSecond / 8) ? 1024 : (m_wave.AverageBytesPerSecond / 8);
			m_notifySize -= m_notifySize % m_wave.BlockAlign;   
			m_capBuffSize = m_notifySize * NUMBER_OF_RECORD_NOTIFICATION;
			m_wave.FormatTag = WaveFormatTag.Pcm;
			CaptureBufferDescription cbds = new CaptureBufferDescription();
			cbds.BufferBytes = m_capBuffSize;
	        cbds.Format = m_wave;
		
			m_capBuffer = new CaptureBuffer(cbds, m_capDevice);			

I set the device as "primary sound capture driver" and get the exception: "Value does not fall within the excepted range" Does anybody know what is wrong? thanks!
Advertisement
And another question.
when i try to use some audio devices, i get the exception:
"Error in application" - what is that supposed to mean? what's the error and how can i solve it?
thanks!
Don't mess with that crap unless you have to. I used FMOD recently for recording sounds in a C# project and it was great.

Shedletsky's Bits: A Blog | ROBLOX | Twitter
Time held me green and dying
Though I sang in my chains like the sea...

This topic is closed to new replies.

Advertisement