Sign in to follow this  
Mobster

[.net] Capturing sound

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this