Jump to content
  • Advertisement
Sign in to follow this  
Mobster

[.net] Capturing sound

This topic is 4493 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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!

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!