Question

I want to start programming a synthesizer. I reckoned that I would need to use the sound card, so I started to google. After a while, discovered many options:
  - WaveOut API - I've heard that this one is outdated, so I scrapped this one.
  - WASAPI - Seemed a little bit too low level for what I wanted.
  - DirectSound, XAudio, XAudio2 - Seem reasonably fine, but I want to have as little latency as possible.
  - Asio - Seemed like exactly what I want!

I did find a couple of tutorials and source code to get me started on audio programming. Sadly, the only one I got to work uses the waveOpen API, which I don't want to use.

Then I found this tutorial, which seemed perfect for my needs. This tutorial is, suprisingly, the only usable (well, not that usable since I can't get it to work) resource I can find on using ASIO. Thing is, I can't get it to work. When I run the demo I get a 'Application has stopped working'-error, followed by the console output:

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'BlueWave.Interop.Asio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'BlueWave.Interop.Asio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' at BlueWave.Interop.Asio.Test.TestConsole.Main(String[] args)

WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

When I try to compile, I got a whole lot of Rosie errors: the errors I get, duh

This is after I manually placed msvcr90.dll and msvcd90.dll in C:\Windows\System32 (I couldn't get them to install any other way). Ow yeah, and of course I installed ASIO4ALL before all this.

So, this is not really a question, but I'm merely asking for general advice. I think it shouldn't be THAT hard to get asio working, but at the same time a link to another resource for learning the ASIO API would be great, as well as any other advice. (Maybe it's easier to just go and try to get Xaudio2 working? I don't know...)

Thanks in advance, and sorry if you think my question is a long or boring read!

EDIT: Thanks for the reactions. I have come across the ASIOHost API by TropicalProgrammer. No idea if it's any good, but it looks promising. I'm looking into it currently. There may be better options, but I have to admit that I got my mind set on ASIO currently.

Was it helpful?

Solution

I suggest having a look at Juce which is a dual-licensed audio framework for writing both audio plug-ins and host applications. Quite a few commercial applications have been built using it.

Since your objective is to build a synthesiser, the path of least resistance is to build it as a VST plug-in. JUCE provides a host application that takes care of managing the OS's audio APIs, good documentation and numerous examples. All you will need to do is implement the render-callback for your synth.

As for ASIO, a great many pro-audio applications have been built with it, mainly because of the traditional shortcomings of the normal audio APIs on successive versions of Windows - particularly where latency or high channel-count is concerned. On Windows, ASIO uses dedicated drivers for the audio hardware and bypasses the host operating system's audio stack. I suspect Juce will take care of this for you.

OTHER TIPS

Not a really helpful answer, but I decided to go with XAUDIO2. I wouldn't really say it's easy to use, but at least there are tutorials available (I use this one, but microsoft has a serie available as well).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top