filoe / cscore

An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
Other
2.15k stars 451 forks source link

CoreAudioAPIException while recording and connecting with Windows RDC #350

Open tbdx opened 6 years ago

tbdx commented 6 years ago

Using WasapiCapture or WasapiLoopbackCapture, when recording on a client you connect to using Windows Remote Desktop Client (ensuring audio options are "play on remote") I get an Exception thrown: 'CSCore.CoreAudioAPI.CoreAudioAPIException' and the SoundInSource DataAvailable event is no longer triggered.

I have confirmed this using the included sample Recorder unmodified.

If you start another recording it does work, it is only when currently recording while you either connect or disconnect.

Currently only confirmed against Windows 10 1709 and 1803

filoe commented 6 years ago

Please use the Stopped event, which should provide the exception object for some further details.

tbdx commented 6 years ago

Thanks Florian,

The exception message property has the value of {"IAudioCaptureClient::GetNextPacketSize caused an error: 0x88890004, \"Unknown HRESULT\"."}

Exception Object (https://user-images.githubusercontent.com/1904968/40814940-8a43aa7a-6586-11e8-9cbb-ceea426bec71.png)