Вы не заявляете свою операционную систему, но я собираюсь взять удар и сказать "Linux".
Наблюдение, что пишется в stderr и stdout, вероятно, не собирается помогать. Если это полезно, Вы могли бы использовать мишень (1) перед запуском сценария, чтобы сделать копию stderr и stdout.
можно использовать PS (1) для поиска wchan. Это говорит Вам, чего ожидает процесс. При рассмотрении вывода strace можно проигнорировать объем вывода и определить последний (заблокированный) системный вызов. Если это - операция на дескрипторе файла, можно пойти назад в выводе и определить основной объект (файл, сокет, канал, и т.д.) Оттуда, ответ, вероятно, будет четким.
можно также отправить процессу сигнал, который заставляет его выводить ядро, и затем использовать отладчик и базовый файл для получения отслеживания стека.
The order of devices is non deterministic for all versions of Windows. For Vista and above, the devices are typically ordered by the DSound GUID (more-or-less) so they're effectively random.
This is what I have come up with so far and it works for us.
Using WMI you can get the DeviceID from Win32_SoundDevice. Then using that you can access the registery at HKLM\SYSTEM\CurrentControlSet\ENUM\'DeviceID' and get the string value named "Driver". This value contains the ClassGUID plus a number at the end.
Example: {4d36e96c-e325-11ce-bfc1-08002be10318}\0015
If you strip off that last number*(15)* for all of you sound devices and order them, that is the order that the devices are listed from NAudio with uses winmm.dll. There is also a location for these sound devices, either in the registery at the same key or from Win32_PNPEntity using the DeviceID.
In our case the location lets us determine which port of the USB hub that sound device is plugged into.
Я предполагаю вы используете WaveOut? Вы можете вызвать WaveOut.GetCapabilities (deviceNumber), чтобы узнать имя устройства, которое может вам помочь.
Прочтите эту статью MSDN. Он использует DirectSound для перечисления аудиоустройств:
http://msdn.microsoft.com/en-us/library/bb318674 (VS.85) .aspx