Sign in to follow this  
benryves

Output runtime-generated sound

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

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