First, understand that the microphone can't be used as a malware vector without a program actively interpreting the data being received by it. You can bleep all you want, but unless some kind of program is listening, reading, and processing the digitized input from the mic, there's nothing entering your computer to perform an exploit.
If you have malware audio somehow floating around in the air near your microphone, you've got an attacker that's very nearby. The wolf has already entered the barn, and is eyeing the sheep. But let's move on to the next part and assume that you have untrustworthy people near your microphone, perhaps sitting next to you in a coffee shop. Now what?
Low level OS or Analog Audio App
If you have some low level hardware or OS program reading the information from the audio digitizer, you have the potential for malware as you would from any unchecked input source. For example, perhaps you have a microphone level utility. It's possible that certain kinds of input could cause a buffer overflow. The problem with using this directly as a vector is that an audio signal is highly variable. Malware needs to send machine instructions, not words and phrases or tones. If you want the victim to receive exactly the bytes of 58 35 4f 21 50 25 40 41 50 (an example from the EICAR pattern) then you have to make a very precise sequence of sounds to make the microphone vibrate in that pattern. But such a sound would be affected by the distance from the speaker to the mic, dampened by a piece of paper, echoed from a tabletop, masked by a vent, or echoes suppressed by a nearby person's body. Plus, there's no feedback to the malware to tell it if it's close or far. The normal background sounds of a coffee shop would suppress any such attack.
This also requires a very badly coded app, one that doesn't actually work. All such simple programs of the type that paint a continuous line level on the screen would fail quickly if they actually had a buffer overflow problem.
So for a low level attack, you're still very safe. It is highly unlikely that malware could successfully be injected under ideal conditions, let alone the real world.
Interpreting audio app
Let's say you have an analog listening program that is actively parsing data and attempting to use it. The sonar program you mentioned would be an example, but perhaps you have a touch-tone listening app - (something like Skype, perhaps?) Certainly, DTMF tones could be interpreted by the victim's computer. They'd also be audible to the user. I suppose it's conceivable that an attacker could get your Skype to call a +1-900-SPEND-MONEY number after you dial a credit card service. But could he realistically touch-tone in a full buffer overflow attack?
A related attack might come from exploiting Shazam. An evildoer could register a malware link with Shazam for a certain piece of audio, and when the interested Shazam user taps the button to "learn more", his browser travels to the infected site.
Another possibility could come from Siri. Perhaps your attacker can convince Siri to open some kind of malware link to infect your phone. Again, not particularly realistic, but it's a potential vector.
Digital audio app
So let's move to the case where you have software that is actually listening for digital audio communications. Shopkick comes to mind, as many people have it installed on their iPhones. Yes, it's technically possible that such an application is badly coded and could permit an attack through the mic. But it's somewhat more likely that a digital attacker would be more successful at masking or confusing the audio than actually finding a bug to exploit.
Digital audio malware app
If the story was true, the BadBIOS attack is malware that is actively using ultrasonic sounds to communicate between machines. Of course, if you already have malware on your system, you already have malware on your system! The wolf not only entered your barn, but he ate your sheep. There's little point in worrying about the communication vector of the malware, because your system is already owned by someone else.
Ultimately, I don't think there are a lot of risks you're taking by using audio applications. The highest risk of any of these activities is likely downloading sonar from a random source on the web.
Bottom line - what is the highest risk?
The highest risk of all is that you could live in irrational fear of random ultrasonic beeps, and so miss out on the advantages you might gain from using digital audio applications.