Jump to content
  • Advertisement
Sign in to follow this  
benryves

Output runtime-generated sound

This topic is 3849 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

I'll try and keep this simple. Sixty times a second, I generate one video frame and 1/60th second of audio samples. I cannot tell what the image or sound are going to be ahead of time. The image can be presented in a number of ways; this is easy (I copy to a texture and render a quad in D3D). I have no idea how the sound can be output. This is my question: how can it be output?
Boring footnote: I have been informed that the waveOut API and DirectSound can both do what I need, but I do not know how and cannot find any relevant information about either. Most of my previous attempts (I have been working on this problem for well over a year now!) have been based around constantly filling a sound buffer with FMOD via callbacks, but the erratic rate of callbacks has meant that I cannot keep audio and video in sync, and however small I set the buffer there's a good 2 second lag.

Share this post


Link to post
Share on other sites
Advertisement
If you need really low latency sound out try ASIO, it should beat both WaveOut and DSound when implemented natively, but sometimes it's wrapped around DSound. Also, from what I hear Vista's WaveOut should have lower latency than XP's, so that might be an option for you.

Share this post


Link to post
Share on other sites
http://www.music.mcgill.ca/~gary/rtaudio/

Mildly annoying to compile under visual studio, but it's cross platform realtime audio

Share this post


Link to post
Share on other sites
Random thought: If D3D is working for what you need, that's great, but I think device-independant bitmaps (see CreateDIBSection) would serve your image-display purposes as well and would be a lot simpler.

Share this post


Link to post
Share on other sites
Cheers; I'm sorry if the original post sounds extremely lazy (which it is, deliberately - I've had nothing but problems with the techniques I've tried, so was hoping for fresh pointers).

Quote:
Original post by cshowe
http://www.music.mcgill.ca/~gary/rtaudio/

Mildly annoying to compile under visual studio, but it's cross platform realtime audio
Quote:
Original post by Extrarius
Random thought: If D3D is working for what you need, that's great, but I think device-independant bitmaps (see CreateDIBSection) would serve your image-display purposes as well and would be a lot simpler.

In both cases; I'm using managed code (C#, WinForms, SlimDX - so cross-language APIs like waveOut and DirectX are fine). I'd had difficulties with the waveOut API trashing memory, but as sod's law dictates within minutes of posting this thread I found what looks to be a working wrapper so I'll give it another chance.

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!