WASAPIってようわからん

Windowsのオーディオシステムと紛らわしいVB-Audio Voicemeeterの用語“の延長。

WASAPIってようわからん。混乱するんだが、その理由の1つはVistaで導入されてから、機能が拡充されてきているため、結果として矛盾する記述が見当たるため。

なんかを見て自分なりにまとめると:

  • 排他(exclusive)モードでデバイスをオープンすると、他のアプリケーションからはそのデバイスはアクセスできなくなる。そのデバイスへの出力は、OSのオーディマネジャを介さず直接「ビットパーフェクト」で出力される。コントロールパネルで設定できるデフォルトフォーマットは共有(shared)モードでのみ適用される設定で、排他(exclusive)モードのときには関係ない。出力先のサウンドチップがサポートしているフォーマットは全てOK。逆に、サポートしていないものは再生できない。
  • WASAPIではリサンプリングが行われず、入力元と出力先のフォーマットが完全に一致しなくてはならない、といった記載が見られるが、おそらくこれはWASAPIが導入されたVistaの時代の話。Windows 7で共有モードでのリサンプリングがサポートされた模様。
広告

Why I Don’t Use Stereo Mix in Injecting Audio into Skype Calls

If you are a Skype or VOIP user on Windows, you sometimes want to play audio, perhaps your favorite song, during a call so the other party “on the line” can hear it too. Achieving this is not as trivial as it seems.

Using the Stereo Mix device was the go-to method for recording whatever comes out of your speakers (see, for example, “How to Record the Sound Coming From Your PC (Even Without Stereo Mix)“). Why can this method not be used to achieve my goal?

Actually, it can, if you want to either speak or play audio, but not at the same time. This video explains how. You’d have to switch the recording device of your Skype client often and, I don’t know about you, but I would definitely find that bothersome. Plus I want to speak and play audio at the same time. This means mixing of these two sound streams needs to happen before it is fed to your Skype client.

For the Skype client software to be able to listen to your mic input and also the audio you play on my PC using, say, Windows Media Player, the Skype client’s recording device should be set to the Stereo Mix device. To make the mic input be routed to the Stereo Mix device, in the Sound control panel, you have to make a few changes:

Then your Skype client software needs to be configured to use the Stereo Mix device as its recording device. This video pretty much sums this all up in an easier-to-understand way.

However, the problem is the Stereo Mix device outputs audio. If it is configured to output to speakers, the audio output from the speakers gets picked up by the microphone and creates an audio feedback loop, which will cause instant howling. If you use a headset or a headphone, the howling can be avoided, but you will still not like the fact that the whatever you say to the mic is replayed into your ears. “Windows 7 OS – Audacity Wiki” discusses this in the section titled “No ‘silent’ recording of computer playback using stereo mix.”