Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Empty audio frames in the TestNetCoreConsole when connected with a Desktop Client #858

Open
tghanem opened this issue Mar 15, 2022 · 0 comments

Comments

@tghanem
Copy link

tghanem commented Mar 15, 2022

Describe the bug
I have run the TestNetCoreConsole example program but with a handler to the AudioTrackAdded event and received the audio frames from the peer. The problem is that I receive empty frames. The same code when run with the webrtc.html JavaScript client (from the TestReceiveAV project) works fine and I receive full frames.

To Reproduce

  1. Open the TestNetCoreConsole example project.
  2. Add the following handler to the PeerConnection object.
pc.AudioTrackAdded += track =>
{
   track.AudioFrameReady += frame =>
   {
      byte firstByte = Marshal.ReadByte(frame.audioData); //THIS IS ALWAYS ZERO which means empty frames are received.
   };
};
  1. Run two instances of the project with one of the instances with the -a switch to add an audio track.
  2. Run the project again but now with the webrtc.html client (from the TestReceiveAV project) and should get frames with data.

Expected behavior
I expected to receive data in the audio frames when the audio track is added by a C# (Desktop) client.

Logging
(core_audio_input_win.cc:94): webrtc::webrtc_win::CoreAudioInput::InitRecording
(datachannel.cc:668): Sent CONTROL message on channel 0
(core_audio_input_win.cc:200): webrtc::webrtc_win::CoreAudioInput::Recording: 0
DataChannel 'data_channel_0f09bfdf-8857-498b-9eb6-84bf0cc4e5c0': StateChanged 'Open'
(core_audio_base_win.cc:297): webrtc::webrtc_win::CoreAudioBase::Init[Input]
(core_audio_utility_win.cc:611): GetDefaultInputDeviceID
(core_audio_utility_win.cc:641): CreateDevice
(core_audio_utility_win.cc:266): CreateDeviceInternal: 0
(core_audio_utility_win.cc:625): GetCommunicationsInputDeviceID
(core_audio_utility_win.cc:641): CreateDevice
(core_audio_utility_win.cc:266): CreateDeviceInternal: 2
(core_audio_base_win.cc:329): Using IAudioClient2
(core_audio_utility_win.cc:772): CreateClient2
(core_audio_utility_win.cc:641): CreateDevice
(core_audio_utility_win.cc:266): CreateDeviceInternal: 2
(core_audio_utility_win.cc:287): IMMDeviceEnumerator::GetDevice failed: The parameter is incorrect. (0x80070057)
(webrtcvoiceengine.cc:1735): Failed to initialize recording
(audio_device_module_win.cc:327): webrtc::webrtc_win::'anonymous-namespace'::WindowsAudioDeviceModule::Recording
(core_audio_input_win.cc:230): webrtc::webrtc_win::CoreAudioInput::Restarting
(core_audio_input_win.cc:200): webrtc::webrtc_win::CoreAudioInput::Recording: 0
(audio_device_module_win.cc:275): webrtc::webrtc_win::'anonymous-namespace'::WindowsAudioDeviceModule::InitRecording
(core_audio_input_win.cc:230): webrtc::webrtc_win::CoreAudioInput::Restarting
(core_audio_input_win.cc:88): webrtc::webrtc_win::CoreAudioInput::RecordingIsInitialized: 0
(core_audio_input_win.cc:94): webrtc::webrtc_win::CoreAudioInput::InitRecording
(core_audio_input_win.cc:200): webrtc::webrtc_win::CoreAudioInput::Recording: 0
(core_audio_base_win.cc:297): webrtc::webrtc_win::CoreAudioBase::Init[Input]
(core_audio_utility_win.cc:611): GetDefaultInputDeviceID
(core_audio_utility_win.cc:641): CreateDevice
(core_audio_utility_win.cc:266): CreateDeviceInternal: 0
(core_audio_utility_win.cc:625): GetCommunicationsInputDeviceID
(core_audio_utility_win.cc:641): CreateDevice
(core_audio_utility_win.cc:266): CreateDeviceInternal: 2
(core_audio_base_win.cc:329): Using IAudioClient2
(core_audio_utility_win.cc:772): CreateClient2
(core_audio_utility_win.cc:641): CreateDevice
(core_audio_utility_win.cc:266): CreateDeviceInternal: 2
(core_audio_utility_win.cc:287): IMMDeviceEnumerator::GetDevice failed: The parameter is incorrect. (0x80070057)
(audio_state.cc:106): webrtc::internal::AudioState::AddSendingStream: Failed to initialize recording.

@tghanem tghanem changed the title Empty audio frames in the TestReceiveAV when connected with a Desktop Client Empty audio frames in the TestNetCoreConsole when connected with a Desktop Client Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant