Skip to content

Commit

Permalink
Save the redundant audio worker code during build time so that the wo…
Browse files Browse the repository at this point in the history
…rker code stays intact and is able to be loaded

The redundant audio worker code string may vary based on the build system of different projects. Because of this, certain build systems will cause invalid worker code to be generated and the redundant audio worker will not be able to run. Now, the redundant audio worker code is saved at build time so that all clients can run the redundant audio worker with the same exact code, regardless of the client's build system.

This issue was originally found in #2771.
  • Loading branch information
dinmin-amzn committed Oct 7, 2023
1 parent 12418f3 commit b442d9b
Show file tree
Hide file tree
Showing 19 changed files with 1,311 additions and 1,212 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.npmrc
__data*
build
config/tsconfig.red.json
coverage
demos/browser/logs/
demos/components/node_modules
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

### Fixed
- Save the redundant audio worker code during build time so that the worker code stays intact and is able to be loaded

## [3.18.1] - 2023-09-29

Expand Down
2,157 changes: 1,080 additions & 1,077 deletions docs/assets/js/search.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/classes/defaulttransceivercontroller.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ <h3>add<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/transceivercontroller.html">TransceiverController</a>.<a href="../interfaces/transceivercontroller.html#addredundantaudiorecoverymetricsobserver">addRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L827">src/transceivercontroller/DefaultTransceiverController.ts:827</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L815">src/transceivercontroller/DefaultTransceiverController.ts:815</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -313,7 +313,7 @@ <h3><span class="tsd-flag ts-flagProtected">Protected</span> add<wbr>Transceiver
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L591">src/transceivercontroller/DefaultTransceiverController.ts:591</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L579">src/transceivercontroller/DefaultTransceiverController.ts:579</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -478,7 +478,7 @@ <h3>metrics<wbr>Did<wbr>Receive</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#metricsdidreceive">metricsDidReceive</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L660">src/transceivercontroller/DefaultTransceiverController.ts:660</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L648">src/transceivercontroller/DefaultTransceiverController.ts:648</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -507,7 +507,7 @@ <h3>remove<wbr>Redundant<wbr>Audio<wbr>Recovery<wbr>Metrics<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/transceivercontroller.html">TransceiverController</a>.<a href="../interfaces/transceivercontroller.html#removeredundantaudiorecoverymetricsobserver">removeRedundantAudioRecoveryMetricsObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L831">src/transceivercontroller/DefaultTransceiverController.ts:831</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L819">src/transceivercontroller/DefaultTransceiverController.ts:819</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -617,7 +617,7 @@ <h3>set<wbr>Audio<wbr>Payload<wbr>Types</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/transceivercontroller.html">TransceiverController</a>.<a href="../interfaces/transceivercontroller.html#setaudiopayloadtypes">setAudioPayloadTypes</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L646">src/transceivercontroller/DefaultTransceiverController.ts:646</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/transceivercontroller/DefaultTransceiverController.ts#L634">src/transceivercontroller/DefaultTransceiverController.ts:634</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
72 changes: 36 additions & 36 deletions docs/classes/redundantaudioencoder.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h3>Constructors</h3>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="redundantaudioencoder.html#shouldlogdebug" class="tsd-kind-icon">should<wbr>Log<wbr>Debug</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="redundantaudioencoder.html#shouldlog" class="tsd-kind-icon">should<wbr>Log</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="redundantaudioencoder.html#shouldreportstats" class="tsd-kind-icon">should<wbr>Report<wbr>Stats</a></li>
</ul>
</section>
Expand All @@ -100,9 +100,9 @@ <h3>Methods</h3>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="redundantaudioencoder.html#setuppassthroughtransform" class="tsd-kind-icon">setup<wbr>Passthrough<wbr>Transform</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="redundantaudioencoder.html#setupreceivertransform" class="tsd-kind-icon">setup<wbr>Receiver<wbr>Transform</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="redundantaudioencoder.html#setupsendertransform" class="tsd-kind-icon">setup<wbr>Sender<wbr>Transform</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="redundantaudioencoder.html#debuglog" class="tsd-kind-icon">debug<wbr>Log</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="redundantaudioencoder.html#getnumredundantencodingsforpacketloss" class="tsd-kind-icon">get<wbr>Num<wbr>Redundant<wbr>Encodings<wbr>For<wbr>Packet<wbr>Loss</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="redundantaudioencoder.html#initializeworker" class="tsd-kind-icon">initialize<wbr>Worker</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="redundantaudioencoder.html#log" class="tsd-kind-icon">log</a></li>
</ul>
</section>
</div>
Expand Down Expand Up @@ -131,9 +131,9 @@ <h4 class="tsd-returns-title">Returns <a href="redundantaudioencoder.html" class
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static">
<a name="shouldlogdebug" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> should<wbr>Log<wbr>Debug</h3>
<div class="tsd-signature tsd-kind-icon">should<wbr>Log<wbr>Debug<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></div>
<a name="shouldlog" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> should<wbr>Log</h3>
<div class="tsd-signature tsd-kind-icon">should<wbr>Log<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/redundantaudioencoder/RedundantAudioEncoder.ts#L69">src/redundantaudioencoder/RedundantAudioEncoder.ts:69</a></li>
Expand Down Expand Up @@ -247,7 +247,7 @@ <h3>set<wbr>Redundancy<wbr>Enabled</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/redundantaudioencoder/RedundantAudioEncoder.ts#L227">src/redundantaudioencoder/RedundantAudioEncoder.ts:227</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/redundantaudioencoder/RedundantAudioEncoder.ts#L225">src/redundantaudioencoder/RedundantAudioEncoder.ts:225</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -360,81 +360,81 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="debuglog" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> debug<wbr>Log</h3>
<a name="getnumredundantencodingsforpacketloss" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> get<wbr>Num<wbr>Redundant<wbr>Encodings<wbr>For<wbr>Packet<wbr>Loss</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">debug<wbr>Log<span class="tsd-signature-symbol">(</span>msg<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
<li class="tsd-signature tsd-kind-icon">get<wbr>Num<wbr>Redundant<wbr>Encodings<wbr>For<wbr>Packet<wbr>Loss<span class="tsd-signature-symbol">(</span>packetLoss<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">]</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/redundantaudioencoder/RedundantAudioEncoder.ts#L131">src/redundantaudioencoder/RedundantAudioEncoder.ts:131</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/redundantaudioencoder/RedundantAudioEncoder.ts#L146">src/redundantaudioencoder/RedundantAudioEncoder.ts:146</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Post logs to the main thread</p>
<p>Returns the number of encodings based on packetLoss value. This is used by <code>DefaultTransceiverController</code> to
determine when to alert the encoder to update the number of encodings. It also determines if we need to
turn off red in cases of very high packet loss to avoid congestion collapse.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>msg: <span class="tsd-signature-type">string</span></h5>
<h5>packetLoss: <span class="tsd-signature-type">number</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">]</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="getnumredundantencodingsforpacketloss" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> get<wbr>Num<wbr>Redundant<wbr>Encodings<wbr>For<wbr>Packet<wbr>Loss</h3>
<a name="initializeworker" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> initialize<wbr>Worker</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">get<wbr>Num<wbr>Redundant<wbr>Encodings<wbr>For<wbr>Packet<wbr>Loss<span class="tsd-signature-symbol">(</span>packetLoss<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">]</span></li>
<li class="tsd-signature tsd-kind-icon">initialize<wbr>Worker<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/redundantaudioencoder/RedundantAudioEncoder.ts#L146">src/redundantaudioencoder/RedundantAudioEncoder.ts:146</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/redundantaudioencoder/RedundantAudioEncoder.ts#L86">src/redundantaudioencoder/RedundantAudioEncoder.ts:86</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the number of encodings based on packetLoss value. This is used by <code>DefaultTransceiverController</code> to
determine when to alert the encoder to update the number of encodings. It also determines if we need to
turn off red in cases of very high packet loss to avoid congestion collapse.</p>
<p>Creates an instance of RedundantAudioEncoder and sets up callbacks.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>packetLoss: <span class="tsd-signature-type">number</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">]</span></h4>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="initializeworker" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> initialize<wbr>Worker</h3>
<a name="log" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> log</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">initialize<wbr>Worker<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
<li class="tsd-signature tsd-kind-icon">log<span class="tsd-signature-symbol">(</span>msg<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/redundantaudioencoder/RedundantAudioEncoder.ts#L86">src/redundantaudioencoder/RedundantAudioEncoder.ts:86</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/redundantaudioencoder/RedundantAudioEncoder.ts#L131">src/redundantaudioencoder/RedundantAudioEncoder.ts:131</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates an instance of RedundantAudioEncoder and sets up callbacks.</p>
<p>Post logs to the main thread</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>msg: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
Expand All @@ -460,7 +460,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
<a href="redundantaudioencoder.html#constructor" class="tsd-kind-icon">constructor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
<a href="redundantaudioencoder.html#shouldlogdebug" class="tsd-kind-icon">should<wbr>Log<wbr>Debug</a>
<a href="redundantaudioencoder.html#shouldlog" class="tsd-kind-icon">should<wbr>Log</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-static">
<a href="redundantaudioencoder.html#shouldreportstats" class="tsd-kind-icon">should<wbr>Report<wbr>Stats</a>
Expand All @@ -486,15 +486,15 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="redundantaudioencoder.html#setupsendertransform" class="tsd-kind-icon">setup<wbr>Sender<wbr>Transform</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a href="redundantaudioencoder.html#debuglog" class="tsd-kind-icon">debug<wbr>Log</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a href="redundantaudioencoder.html#getnumredundantencodingsforpacketloss" class="tsd-kind-icon">get<wbr>Num<wbr>Redundant<wbr>Encodings<wbr>For<wbr>Packet<wbr>Loss</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a href="redundantaudioencoder.html#initializeworker" class="tsd-kind-icon">initialize<wbr>Worker</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a href="redundantaudioencoder.html#log" class="tsd-kind-icon">log</a>
</li>
</ul>
</li>
</ul>
Expand Down
Loading

0 comments on commit b442d9b

Please sign in to comment.