Skip to content

Commit e5bf900

Browse files
kannan-xiao4miyabiH3idi-Xchrstphrsxtnsindharta-tanuwijaya
authored
Rebase/original 3.0.0 pre.8 (#8)
* Improve API documentation * Improve documentation of VideoStreamTrack * Improve documentation of MediaStream * Improve documentation of RTCConfiguration * Improve documentation of MediaStreamTrack * Improve documentation of AudioStreamTrack * Improve documentation of WebRTC * On the way. * Improve documentation of RTCRtpTransceiver * On the way. * Improve documentation of RTCIceServer * Refine examples * On the way. * Added summary for RTCDataChannelInit class. * Added Exceptions doc to Send(). * Improve documentation of RTCRtpSender * Improved the example in RTCDataChannel. * Improve examples * Improve examples * Added some Remarks. * Improve examples * Improve examples * Improve examples * Improve examples * Improve examples * Improve examples * Improve examples * Adding Remarks. * Added Remarks. * Added sample programs. * Fixed typo "chennel". * Imroved description for ordered. * modifying summaries. * Improved protocol property. * Done for RTCDataChannelInit. * Update Runtime/Scripts/WebRTC.cs Co-authored-by: chrstphrsxtn <[email protected]> * wip. * Improve documentation of RTCRtpEncodingParameters * Filled the all. * Added more samples. * Improved exception. * fixing source code formatting errors. * refactor: move CameraExtension class to its own file (Unity-Technologies#1064) * Update Runtime/Scripts/MediaStreamTrack.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/AudioStreamTrack.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/AudioStreamTrack.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/AudioStreamTrack.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/AudioStreamTrack.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/WebRTC.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/WebRTC.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/WebRTC.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/WebRTC.cs Co-authored-by: chrstphrsxtn <[email protected]> * gitignore: ignore UserSettings and Logs (Unity-Technologies#1068) * Update Runtime/Scripts/RTCDataChannel.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/RTCDataChannel.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/RTCDataChannel.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/RTCDataChannel.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/RTCDataChannel.cs Co-authored-by: chrstphrsxtn <[email protected]> * Update Runtime/Scripts/RTCDataChannel.cs Co-authored-by: chrstphrsxtn <[email protected]> * doc: improve the API doc of RTCSessionDescription (Unity-Technologies#1067) * initial improvement * rewrite * add sample code * project: add a symbolic link to the Documentation folder (Unity-Technologies#1070) * doc: improve the API doc of CameraExtension (Unity-Technologies#1073) * add documentation * add class summary * simplify code * update example * readme: update Unity badges (Unity-Technologies#1074) * release: 3.0.0-pre.8 (Unity-Technologies#1075) * update package.json * update changelog * update readme * update ValidationExceptions.json * update install.md * update bug_report.yml * Feat: libwebrtc update m124 (#1) * update buildscript on mac * update buildscript on win * update buildscript on linux * update android buildscript * update windows libwebrtc buid * update mac build(disable replace task queue) * update deployment target (#2) * fix linux plugin build on ubuntu 22.04 (#3) * change package and readme (#5) * Fix: createimage vulkan android own (#4) * add error logs * add VkMemoryDedicatedAllocateInfo on android * update sample project settings * fix project * update plugin win/linux/android * update plugin mac/ios * Fix: crash android vulkan (#7) * fix meta * workaround avoid crash access to i420 * update android aar * update version 3.0.2-pre.7 --------- Signed-off-by: Takashi Kannan <[email protected]> Co-authored-by: Masayuki Iwai <[email protected]> Co-authored-by: toshiyuki <[email protected]> Co-authored-by: chrstphrsxtn <[email protected]> Co-authored-by: sindharta-tanuwijaya <[email protected]> Co-authored-by: H3idi-X <[email protected]>
1 parent 7bf0b59 commit e5bf900

21 files changed

+2650
-494
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ body:
2727
What version of the package are you using?
2828
You can check the Unity version in Package Manager Window. See [manual](https://docs.unity3d.com/Manual/upm-ui.html).
2929
options:
30+
- 3.0.0-pre.8
3031
- 3.0.0-pre.7
3132
- 3.0.0-pre.6
3233
- 3.0.0-pre.5

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ upm-ci~/
222222
Plugin~/webrtc*/*
223223
WebRTC~/CodeCoverage
224224
WebRTC~/TestResults-*
225+
WebRTC~/Logs
225226
*.dbmdl
226227
*.dbproj.schemaview
227228
*.jfm
@@ -363,6 +364,7 @@ Plugin~/WebRTCPluginTest/webrtc-test.xcodeproj/*
363364
[Tt]emp/
364365
[Oo]bj/
365366
[Bb]uild/
367+
[Uu]serSettings/
366368

367369
# Exclude Documentation folder
368370
!Documentation~

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ All notable changes to the webrtc package will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [3.0.0-pre.8] - 2024-12-12
8+
9+
### Changed
10+
- doc: improve the API doc of CameraExtension
11+
- doc: improve the API doc of RTCSessionDescription
12+
- doc: improve the API doc of RTCDataChannel
13+
- doc: Improve the API doc of RTCConfiguration
14+
- doc: Improve the API doc of RTCRtpEncodingParameters
15+
- doc: Improve the API doc of RTCRtpSender
16+
- doc: Improve the API doc of RTCRtpTransceiver
17+
- doc: Improve the API doc of WebRTC
18+
- doc: Improve the API doc of AudioStreamTrack
19+
- doc: Improve the API doc of VideoStreamTrack
20+
- doc: Improve the API doc of MediaStreamTrack
21+
- doc: Improve the API doc of MediaStream
22+
- doc: Improve the API doc of RTCPeerConnection
23+
- doc: Improve the API doc of RTCIceServer
24+
25+
726
## [3.0.0-pre.7] - 2023-10-20
827

928
### Added

Documentation~/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Check Package Manager window, Click `+` button and select `Add package from git
1111
Input the string below to the input field.
1212

1313
```
14-
14+
1515
```
1616

1717
The list of version string is [here](https://github.com/Unity-Technologies/com.unity.webrtc/tags). In most cases, the latest version is recommended to use.

README.md

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This follows the source repository, but distributes the state that incorporates
99
# WebRTC for Unity
1010

1111
<img src="https://img.shields.io/badge/unity-2022.3-green.svg?style=flat-square" alt="unity 2022.3">
12+
<img src="https://img.shields.io/badge/unity-6000.0-green.svg?style=flat-square" alt="unity 2023.1">
13+
1214

1315
**WebRTC for Unity** is a package that allows [WebRTC](https://webrtc.org) to be used in Unity.
1416

@@ -37,32 +39,33 @@ Please read this if you have an interest to customize native code in this projec
3739

3840
## Roadmap
3941

40-
| Version | libwebrtc version | Focus | When |
41-
| ------- | ----------------- | ----- | ---- |
42-
| `1.0.0-preview` | [M72](https://groups.google.com/d/msg/discuss-webrtc/3h4y0fimHwg) | - First release | Sep 2019 |
43-
| `1.1.0-preview` | [M72](https://groups.google.com/d/msg/discuss-webrtc/3h4y0fimHwg) | - IL2CPP Support<br> - Linux platform Support<br/> - Add software encoder | Feb 2020 |
44-
| `2.0.0-preview` | [M79](https://groups.google.com/d/msg/discuss-webrtc/Ozvbd0p7Q1Y) | - Multi camera <br>- DirectX12 (DXR) Support | Apr 2020 |
45-
| `2.1.0-preview` | [M84](https://groups.google.com/g/discuss-webrtc/c/MRAV4jgHYV0) | - Profiler tool <br>- Bitrate control | Aug 2020 |
46-
| `2.2.0-preview` | [M85](https://groups.google.com/g/discuss-webrtc/c/Qq3nsR2w2HU) | - Video decoder (VP8, VP9 only) <br>- Vulkan HW encoder support <br>- MacOS HW encoder support | Oct 2020 |
47-
| `2.3.0-preview` | [M85](https://groups.google.com/g/discuss-webrtc/c/Qq3nsR2w2HU) | - iOS platform support | Dec 2020 |
48-
| `2.4.0-exp.1` | [M89](https://groups.google.com/g/discuss-webrtc/c/Zrsn2hi8FV0) | - Android platform support | Apr 2021 |
49-
| `2.4.0-exp.2` | [M89](https://groups.google.com/g/discuss-webrtc/c/Zrsn2hi8FV0) | - Fix bugs | May 2021 |
50-
| `2.4.0-exp.3` | [M89](https://groups.google.com/g/discuss-webrtc/c/Zrsn2hi8FV0) | - Fix bugs | Jun 2021 |
51-
| `2.4.0-exp.4` | [M89](https://groups.google.com/g/discuss-webrtc/c/Zrsn2hi8FV0) | - Audio renderer support <br>- Apple Silicon support | Aug 2021 |
52-
| `2.4.0-exp.5` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Fix audio streaming issues | Feb 2022 |
53-
| `2.4.0-exp.6` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Hotfix | Feb 2022 |
54-
| `2.4.0-exp.7` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Fix video streaming issues | May 2022 |
55-
| `2.4.0-exp.8` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Fix bugs | Jul 2022 |
56-
| `2.4.0-exp.9` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Hotfix | Aug 2022 |
57-
| `2.4.0-exp.10` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Hotfix | Aug 2022 |
58-
| `2.4.0-exp.11` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Hotfix | Sep 2022 |
59-
| `3.0.0-pre.1` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Fix bugs | Nov 2022 |
60-
| `3.0.0-pre.2` | [M107](https://groups.google.com/g/discuss-webrtc/c/StVFkKuSRc8) | - Update libwebrtc M107 | Dec 2022 |
61-
| `3.0.0-pre.3` | [M107](https://groups.google.com/g/discuss-webrtc/c/StVFkKuSRc8) | - Fix bugs | Dec 2022 |
62-
| `3.0.0-pre.4` | [M107](https://groups.google.com/g/discuss-webrtc/c/StVFkKuSRc8) | - Fix bugs | Jan 2023 |
63-
| `3.0.0-pre.5` | [M107](https://groups.google.com/g/discuss-webrtc/c/StVFkKuSRc8) | - Encoded Transform API | Apr 2023 |
64-
| `3.0.0-pre.6` | [M112](https://groups.google.com/g/discuss-webrtc/c/V-XFau9W9gY) | - Fix bugs | Jul 2023 |
65-
| `3.0.0-pre.7` | [M116](https://groups.google.com/g/discuss-webrtc/c/bEsO8Lz7psE) | - Update libwebrtc M116 <br>- Simulcast for NVIDIA H.264 | Oct 2023 |
42+
| Version | libwebrtc version | Focus | When |
43+
|------------------| ----------------- | ----- | ---- |
44+
| `1.0.0-preview` | [M72](https://groups.google.com/d/msg/discuss-webrtc/3h4y0fimHwg) | - First release | Sep 2019 |
45+
| `1.1.0-preview` | [M72](https://groups.google.com/d/msg/discuss-webrtc/3h4y0fimHwg) | - IL2CPP Support<br> - Linux platform Support<br/> - Add software encoder | Feb 2020 |
46+
| `2.0.0-preview` | [M79](https://groups.google.com/d/msg/discuss-webrtc/Ozvbd0p7Q1Y) | - Multi camera <br>- DirectX12 (DXR) Support | Apr 2020 |
47+
| `2.1.0-preview` | [M84](https://groups.google.com/g/discuss-webrtc/c/MRAV4jgHYV0) | - Profiler tool <br>- Bitrate control | Aug 2020 |
48+
| `2.2.0-preview` | [M85](https://groups.google.com/g/discuss-webrtc/c/Qq3nsR2w2HU) | - Video decoder (VP8, VP9 only) <br>- Vulkan HW encoder support <br>- MacOS HW encoder support | Oct 2020 |
49+
| `2.3.0-preview` | [M85](https://groups.google.com/g/discuss-webrtc/c/Qq3nsR2w2HU) | - iOS platform support | Dec 2020 |
50+
| `2.4.0-exp.1` | [M89](https://groups.google.com/g/discuss-webrtc/c/Zrsn2hi8FV0) | - Android platform support | Apr 2021 |
51+
| `2.4.0-exp.2` | [M89](https://groups.google.com/g/discuss-webrtc/c/Zrsn2hi8FV0) | - Fix bugs | May 2021 |
52+
| `2.4.0-exp.3` | [M89](https://groups.google.com/g/discuss-webrtc/c/Zrsn2hi8FV0) | - Fix bugs | Jun 2021 |
53+
| `2.4.0-exp.4` | [M89](https://groups.google.com/g/discuss-webrtc/c/Zrsn2hi8FV0) | - Audio renderer support <br>- Apple Silicon support | Aug 2021 |
54+
| `2.4.0-exp.5` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Fix audio streaming issues | Feb 2022 |
55+
| `2.4.0-exp.6` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Hotfix | Feb 2022 |
56+
| `2.4.0-exp.7` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Fix video streaming issues | May 2022 |
57+
| `2.4.0-exp.8` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Fix bugs | Jul 2022 |
58+
| `2.4.0-exp.9` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Hotfix | Aug 2022 |
59+
| `2.4.0-exp.10` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Hotfix | Aug 2022 |
60+
| `2.4.0-exp.11` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Hotfix | Sep 2022 |
61+
| `3.0.0-pre.1` | [M92](https://groups.google.com/g/discuss-webrtc/c/hks5zneZJbo) | - Fix bugs | Nov 2022 |
62+
| `3.0.0-pre.2` | [M107](https://groups.google.com/g/discuss-webrtc/c/StVFkKuSRc8) | - Update libwebrtc M107 | Dec 2022 |
63+
| `3.0.0-pre.3` | [M107](https://groups.google.com/g/discuss-webrtc/c/StVFkKuSRc8) | - Fix bugs | Dec 2022 |
64+
| `3.0.0-pre.4` | [M107](https://groups.google.com/g/discuss-webrtc/c/StVFkKuSRc8) | - Fix bugs | Jan 2023 |
65+
| `3.0.0-pre.5` | [M107](https://groups.google.com/g/discuss-webrtc/c/StVFkKuSRc8) | - Encoded Transform API | Apr 2023 |
66+
| `3.0.0-pre.6` | [M112](https://groups.google.com/g/discuss-webrtc/c/V-XFau9W9gY) | - Fix bugs | Jul 2023 |
67+
| `3.0.0-pre.7` | [M116](https://groups.google.com/g/discuss-webrtc/c/bEsO8Lz7psE) | - Update libwebrtc M116 <br>- Simulcast for NVIDIA H.264 | Oct 2023 |
68+
| `3.0.0-pre.8` | [M116](https://groups.google.com/g/discuss-webrtc/c/bEsO8Lz7psE) | | |
6669

6770
## Licenses
6871

Runtime/Scripts/AudioStreamTrack.cs

Lines changed: 127 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,22 @@
77
namespace Unity.WebRTC
88
{
99
/// <summary>
10-
/// This event is called on audio thread.
10+
/// Delegate to be called when new audio data is received.
1111
/// </summary>
12-
/// <param name="data"></param>
13-
/// <param name="channels"></param>
12+
/// <remarks>
13+
/// `AudioReadEventHandler` is a delegate to be called when new audio data is received.
14+
/// </remarks>
15+
/// <param name="data">Float array containing audio data samples.</param>
16+
/// <param name="channels">Number of audio channels.</param>
17+
/// <param name="sampleRate">Sample rate of the audio data</param>
18+
/// <example>
19+
/// <code lang="cs"><![CDATA[
20+
/// audioStreamTrack.onReceived += (data, channels, sampleRate) =>
21+
/// {
22+
/// }
23+
/// ]]></code>
24+
/// </example>
25+
/// <seealso cref="AudioStreamTrack.OnReceived"/>
1426
public delegate void AudioReadEventHandler(float[] data, int channels, int sampleRate);
1527

1628
/// <summary>
@@ -30,12 +42,22 @@ public static void SetTrack(this AudioSource source, AudioStreamTrack track)
3042
}
3143

3244
/// <summary>
33-
///
45+
/// Represents a single audio track within a stream.
3446
/// </summary>
47+
/// <remarks>
48+
/// `AudioStreamTrack` is a `MediaStreamTrack` that represents a single audio track within a stream.
49+
/// </remarks>
50+
/// <example>
51+
/// <code lang="cs"><![CDATA[
52+
/// AudioStreamTrack audioStreamTrack = new AudioStreamTrack(texture);
53+
/// ]]></code>
54+
/// </example>
55+
/// <seealso cref="MediaStreamTrack" />
56+
/// <seealso cref="WebRTC" />
3557
public class AudioStreamTrack : MediaStreamTrack
3658
{
3759
/// <summary>
38-
///
60+
/// AudioSource object.
3961
/// </summary>
4062
public AudioSource Source
4163
{
@@ -182,17 +204,33 @@ internal void SetData(float[] data, int channels, int sampleRate)
182204
internal AudioTrackSource _trackSource;
183205

184206
/// <summary>
185-
///
207+
/// Creates a new AudioStreamTrack object.
186208
/// </summary>
209+
/// <remarks>
210+
/// `AudioStreamTrack` constructor creates an instance of `AudioStreamTrack`.
211+
/// </remarks>
212+
/// <example>
213+
/// <code><![CDATA[
214+
/// AudioStreamTrack audioStreamTrack = new AudioStreamTrack();
215+
/// ]]></code>
216+
/// </example>
187217
public AudioStreamTrack()
188218
: this(Guid.NewGuid().ToString(), new AudioTrackSource())
189219
{
190220
}
191221

192222
/// <summary>
193-
///
223+
/// Creates a new AudioStreamTrack object.
194224
/// </summary>
195-
/// <param name="source"></param>
225+
/// <remarks>
226+
/// `AudioStreamTrack` constructor creates an instance of `AudioStreamTrack` with a `source`.
227+
/// </remarks>
228+
/// <param name="source">`AudioSource` object.</param>
229+
/// <example>
230+
/// <code><![CDATA[
231+
/// AudioStreamTrack audioStreamTrack = new AudioStreamTrack(source);
232+
/// ]]></code>
233+
/// </example>
196234
public AudioStreamTrack(AudioSource source)
197235
: this(Guid.NewGuid().ToString(), new AudioTrackSource())
198236
{
@@ -206,6 +244,18 @@ public AudioStreamTrack(AudioSource source)
206244
_audioCapturer.sender = true;
207245
}
208246

247+
/// <summary>
248+
/// Creates a new AudioStreamTrack object.
249+
/// </summary>
250+
/// <remarks>
251+
/// `AudioStreamTrack` constructor creates an instance of `AudioStreamTrack` with a `listener`.
252+
/// </remarks>
253+
/// <param name="listener">`AudioListener` object.</param>
254+
/// <example>
255+
/// <code><![CDATA[
256+
/// AudioStreamTrack audioStreamTrack = new AudioStreamTrack(listener);
257+
/// ]]></code>
258+
/// </example>
209259
public AudioStreamTrack(AudioListener listener)
210260
: this(Guid.NewGuid().ToString(), new AudioTrackSource())
211261
{
@@ -241,8 +291,16 @@ internal void RemoveSink(AudioStreamRenderer renderer)
241291
}
242292

243293
/// <summary>
244-
///
294+
/// Disposes of AudioStreamTrack.
245295
/// </summary>
296+
/// <remarks>
297+
/// `Dispose` method disposes of the `AudioStreamTrack` and releases the associated resources.
298+
/// </remarks>
299+
/// <example>
300+
/// <code lang="cs"><![CDATA[
301+
/// audioStreamTrack.Dispose();
302+
/// ]]></code>
303+
/// </example>
246304
public override void Dispose()
247305
{
248306
if (this.disposed)
@@ -270,11 +328,19 @@ public override void Dispose()
270328
}
271329

272330
/// <summary>
273-
///
331+
/// Provides the audio data to the track.
274332
/// </summary>
275-
/// <param name="nativeArray"></param>
276-
/// <param name="channels"></param>
277-
/// <param name="sampleRate"></param>
333+
/// <remarks>
334+
/// `SetData` method provides the audio data to the track.
335+
/// </remarks>
336+
/// <param name="nativeArray">`NativeArray<float>` containing audio data samples.</param>
337+
/// <param name="channels">Number of audio channels.</param>
338+
/// <param name="sampleRate">Sample rate of the audio data</param>
339+
/// <example>
340+
/// <code lang="cs"><![CDATA[
341+
/// audioStreamTrack.SetData(nativeArray, channels, sampleRate);
342+
/// ]]></code>
343+
/// </example>
278344
public void SetData(NativeArray<float>.ReadOnly nativeArray, int channels, int sampleRate)
279345
{
280346
unsafe
@@ -285,11 +351,19 @@ public void SetData(NativeArray<float>.ReadOnly nativeArray, int channels, int s
285351
}
286352

287353
/// <summary>
288-
///
354+
/// Provides the audio data to the track.
289355
/// </summary>
290-
/// <param name="nativeSlice"></param>
291-
/// <param name="channels"></param>
292-
/// <param name="sampleRate"></param>
356+
/// <remarks>
357+
/// `SetData` method provides the audio data to the track.
358+
/// </remarks>
359+
/// <param name="nativeSlice">`NativeSlice<float>` containing audio data samples.</param>
360+
/// <param name="channels">Number of audio channels.</param>
361+
/// <param name="sampleRate">Sample rate of the audio data</param>
362+
/// <example>
363+
/// <code lang="cs"><![CDATA[
364+
/// audioStreamTrack.SetData(nativeSlice, channels, sampleRate);
365+
/// ]]></code>
366+
/// </example>
293367
public void SetData(NativeSlice<float> nativeSlice, int channels, int sampleRate)
294368
{
295369
unsafe
@@ -310,11 +384,19 @@ static void ProcessAudio(AudioTrackSource source, IntPtr array, int sampleRate,
310384
}
311385

312386
/// <summary>
313-
///
387+
/// Provides the audio data to the track.
314388
/// </summary>
315-
/// <param name="array"></param>
316-
/// <param name="channels"></param>
317-
/// <param name="sampleRate"></param>
389+
/// <remarks>
390+
/// `SetData` method provides the audio data to the track.
391+
/// </remarks>
392+
/// <param name="array">Float array containing audio data samples.</param>
393+
/// <param name="channels">Number of audio channels.</param>
394+
/// <param name="sampleRate">Sample rate of the audio data</param>
395+
/// <example>
396+
/// <code lang="cs"><![CDATA[
397+
/// audioStreamTrack.SetData(array, channels, sampleRate);
398+
/// ]]></code>
399+
/// </example>
318400
public void SetData(float[] array, int channels, int sampleRate)
319401
{
320402
if (array == null)
@@ -332,11 +414,19 @@ public void SetData(float[] array, int channels, int sampleRate)
332414
// ReadOnlySpan<T> is supported since .NET Standard 2.1.
333415
#if UNITY_2021_2_OR_NEWER
334416
/// <summary>
335-
///
417+
/// Provides the audio data to the track.
336418
/// </summary>
337-
/// <param name="span"></param>
338-
/// <param name="channels"></param>
339-
/// <param name="sampleRate"></param>
419+
/// <remarks>
420+
/// `SetData` method provides the audio data to the track.
421+
/// </remarks>
422+
/// <param name="span">`ReadOnlySpan<float>` containing audio data samples.</param>
423+
/// <param name="channels">Number of audio channels.</param>
424+
/// <param name="sampleRate">Sample rate of the audio data</param>
425+
/// <example>
426+
/// <code lang="cs"><![CDATA[
427+
/// audioStreamTrack.SetData(span, channels, sampleRate);
428+
/// ]]></code>
429+
/// </example>
340430
public void SetData(ReadOnlySpan<float> span, int channels, int sampleRate)
341431
{
342432
unsafe
@@ -350,8 +440,19 @@ public void SetData(ReadOnlySpan<float> span, int channels, int sampleRate)
350440
#endif
351441

352442
/// <summary>
353-
///
443+
/// Event to be fired when new audio data is received.
354444
/// </summary>
445+
/// <remarks>
446+
/// `onReceived` event is fired when new audio data is received.
447+
/// </remarks>
448+
/// <example>
449+
/// <code lang="cs"><![CDATA[
450+
/// audioStreamTrack.onReceived += (data, channels, sampleRate) =>
451+
/// {
452+
/// }
453+
/// ]]></code>
454+
/// </example>
455+
/// <seealso cref="AudioReadEventHandler"/>
355456
public event AudioReadEventHandler onReceived
356457
{
357458
add

0 commit comments

Comments
 (0)