Skip to main content
GameDev.net gamedev.net
🔒 Locked

Output runtime-generated sound

Started by benryves Mar 4, 2008 at 6:30 PM 4 replies 1.6k views
Original Post
benryves
benryves
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.
[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]
Extrarius
Extrarius
The windows Waveform Functions can be used for that purpose.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
outRider
outRider
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.
cshowe
cshowe
http://www.music.mcgill.ca/~gary/rtaudio/

Mildly annoying to compile under visual studio, but it's cross platform realtime audio
Extrarius
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.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
benryves
benryves
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.
[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.