2

I'm writing a Pro Audio application using WASAPI. All of the devices on my machine have a engine format of 16-bit or 24-bit PCM. Considering this, I'm wondering whether or not it's safe to make the assumption that all audio endpoints have PCM as their native format.

Do they? If not, what kind of devices don't?

user2864740
  • 60,010
  • 15
  • 145
  • 220
NmdMystery
  • 2,778
  • 3
  • 32
  • 60
  • The vast majority of pro-audio apps are still using ASIO, despite Microsoft's attempts to introduce audio APIs that don't suck horribly. – marko Apr 24 '14 at 08:06
  • @marko Fair, but I'm not making something exclusively for producers, who actually know how to operate ASIO. WASAPI is my best choice, because it works out of the box and can do the same thing. It actually doesn't suck as far as I'm concerned (unless there's some glaring lack of support I don't know about yet), aside from the whole COM headache it's rather simple to grasp. I also want the choice to process audio synchronously, which ASIO doesn't give you (hence the name). – NmdMystery Apr 24 '14 at 23:15
  • Microsoft more or less a got it right in Vista - although even then, multi-channel audio was more about supporting 5:1 surround than pro applications. The attraction of ASIO to many software authors is that it's cross-platform. On Windows it's bare-metal and exclusively takes over the audio interface. Interestingly on MacOSX it sits on top of CoreAudio and it's entirely possible to have two DAW packages sharing a multi-channel interface with CoreAudio even mixing their outputs together. – marko Apr 26 '14 at 09:56

1 Answers1

1

It is definitely not safe to assume that all devices are 16 or 24 bit PCM. I know that choosing the right format is a big tricky. But it could be also something like 32 bit IeeeFloat. But, as a user you can only set 16 or 24 bit -> it is most of the time 16 or 24 bit. Anyway. You could also use the exclusive mode. In the exclusive mode, you can specify a format yourself. But remember: You have to be allowed to use exclusive mode AND with exclusive mode, all other playbacks on the whole system will be stopped. -> I would not recommend to use exclusive mode. Just check the most important formats like 16 and 24 bit PCM, 32 bit IeeeFloat and the rest is just not supported.

Florian
  • 5,918
  • 3
  • 47
  • 86
  • Upvoted, but I can't accept this as the answer until I know - what kind of endpoints use floating point? Some kind of fancy sound card? – NmdMystery Apr 24 '14 at 23:17
  • It depends on the windows mixer (not the soundcard) which mixes all streams of all applications together. The problem is that there is no specification which tells you that only 16 and 24 bit pcm is possible. So it is possible that any new windows versions are using ieeefloat 32bit (the trend for using float samples is definitely here). So I would recommend you to support IeeeFloat. There is a nice Dmo-Resampler built in since Windows XP which you can use to convert to the a specific format. http://cscore.codeplex.com/SourceControl/latest#CSCore/SoundOut/WasapiOut.cs (`SetupWaveFormat`) – Florian Apr 25 '14 at 07:18