Jump to content
  • Advertisement
Sign in to follow this  
Starfox

Audio on Windows - Why such a mess?

This topic is 2842 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've recently been coding an audio library for Windows among other platforms, and I recently realized that half of the time (seriously) has been spent battling DirectSound8's incompetence. Is there a better way to do audio on Windows (WASAPI is out, as I need to support XP, says the market) that will let me reliably open a PCM stream (a single PCM stream, I need no more. Honest.) to a device of my choosing, without crashing my entire process in cases of address space exhaustion (which I have to deal with - I need to support x86 even though I know the future is 64 bit), and generally being quirky and inadequate when it comes to quality and latency? I looked at ASIO, but I need something I can redistribute - and also I don't want to rely on a lot of redists, as the total length of the English EULA must not exceed eight thousand characters - for all components involved.

[Edited by - LessBread on August 25, 2010 10:28:34 PM]

Share this post


Link to post
Share on other sites
Advertisement
I've never had any crashes with DirectSound. And I think audio on Windows is much less of a mess than it is on Linux, where there are a trillion emulation and compatibility layers and different sound servers and so on.

Where on earth does address space exhaustion come into this? What are you doing?

Share this post


Link to post
Share on other sites
I am using XAudio2, it's simple to use and create classes for and has very good results. Don't understand the complains.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kylotan
I've never had any crashes with DirectSound. And I think audio on Windows is much less of a mess than it is on Linux, where there are a trillion emulation and compatibility layers and different sound servers and so on.

Where on earth does address space exhaustion come into this? What are you doing?


No one (literally, zero out of all surveyed) of our target audience cares about Linux, thankfully.

Here's my problem: grown up code looks like this:


Something* S = malloc(sizeof(Something));
if(S == NULL) return ERR_NO_MEMORY;



The code coming from the DirectSound team is more like this:

Something* S = malloc(sizeof(Something));
S->m_OtherThing = SomeValue; //malloc()? Fail? Nooooo, you must be kidding.



So in an app where memory mapped files are used (and the app is x86-32 for reasons beyond my control), malloc() (actually, VirtualAlloc() and HeapAlloc()) fail due to lack of address space, and the whole process CRASHES AND BURNS.

I need an audio api that's as low level as possible (I do all my own mixing, resampling, etc.), is either built in on can be redistributed without violating my UX guidelines (which limit the TOTAL EULA length to a maximum of eight thousand Unicode characters) and that is ROCK-FRIGGIN-SOLID. And I need to support XP SP3. What are my options?

Share this post


Link to post
Share on other sites
If performance / latency isn't too important, try using the waveout API which is built in to Windows. See http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4422&lngWId=3 for some example code.

Share this post


Link to post
Share on other sites
Quote:
Original post by TTK-Bandit
Tried OpenAL Soft ?


It's literally easier to write an audio library from scratch than it is to patch OpenAL Soft to our stability / performance standards.

Share this post


Link to post
Share on other sites
Quote:
Original post by Adam_42
If performance / latency isn't too important, try using the waveout API which is built in to Windows. See http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4422&lngWId=3 for some example code.


Looking into it, looks good so far. Device enumeration seems to be weak though, and there's no way I could use this with an XInput device, right?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!