Unity-Technologies / Unity-Technologies/com.unity.webrtc

[BUG]: Audio track does not work properly,when the video track is turned off。

Open
#1,045 0 comments 0 reactions 1 assignee View on GitHub

@karasusan is already working on this.

Since Aug 5, 2024.

bug
Dominant language
Assembly
Stars
852
Forks
238
PR merge metrics
No merged PRs in 30d

Description

Package version

3.0.0-pre.7

Environment
* OS:Windows10
* Unity version: Unity 2021.3
Steps To Reproduce
  1. open audioTrack
  2. close videoTrack
Current Behavior

Audio track does not work properly,when the video track is turned off,but when I turn on the video track ,audio track works properly,show my code:
var configuration = GetSelectedSdpSemantics();
localPeerConnection = new RTCPeerConnection(ref configuration);
pcOnIceConnectionChange = state => { OnIceConnectionChange(localPeerConnection, state); };
pcOnIceCandidate = candidate => { OnIceCandidate(localPeerConnection, candidate); };
pcOnNegotiationNeeded = () => { StartCoroutine(PeerNegotiationNeeded(localPeerConnection)); };
AudioStreamTrack audiotrack = new AudioStreamTrack(audioTrack);
VideoStreamTrack track = Capture_Camera.CaptureStreamTrack(146, 146);
var sendStream = new MediaStream();
localPeerConnection.AddTrack(audiotrack, sendStream);
localPeerConnection.AddTrack(track, sendStream);

Expected Behavior

I want to use Audio track only because of the limited hardware environment。

Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.