@@ -93,7 +93,7 @@ const audioWriter = new AudioTrackWriter();
9393videoElem .srcObject = new MediaStream ([audioWriter .track , videoWriter .track ]);
9494
9595// Finally the decoders are created and the encoded media is piped through the decoder
96- // and into the TrackerWriters which conver them into MediaStreamTracks
96+ // and into the TrackerWriters which converts them into MediaStreamTracks.
9797const audioDecoder = new AudioDecoder ({codec: ' opus' });
9898const videoDecoder = new VideoDecoder ({codec: ' vp8' });
9999encodedAudio .pipeThrough (audioDecoder).pipeTo (audioWriter .writable );
@@ -105,16 +105,16 @@ encodedVideo.pipeThrough(videoDecoder).pipeTo(videoWriter.writable);
105105``` javascript
106106// The app provides sources of audio and video, perhaps from getUserMedia.
107107const {audioTrack , videoTrack } = ... ;
108- // The app also provides a way to serizlize /containerize encoded media and upload it.
108+ // The app also provides a way to serialize /containerize encoded media and upload it.
109109// The browser provides the app byte arrays defined by a codec such as vp8 or opus
110110// (not in a media container such as mp4 or webm).
111111function muxAndSend (encodedAudio , encodedVideo ) { ... };
112112
113- // First, the tracks are converted to ReadableStreams of encoded audio and video.
113+ // First, the tracks are converted to ReadableStreams of unencoded audio and video.
114114const audio = (new AudioTrackReader (audioTrack)).readable ;
115115const video = (new VideoTrackReader (videoTrack)).readable ;
116116
117- // Lastly, build the encoders and pass media through them
117+ // Lastly, build the encoders and pass media through them.
118118const audioEncoder = new AudioEncoder ({
119119 codec: ' opus' ,
120120 settings: {
@@ -137,7 +137,7 @@ muxAndSend(encodedAudio, encodedVideo);
137137### Example of transcoding or offline encode/decode
138138
139139``` javascript
140- // App provides a way to demux (decontainerize) and mux (containerize) media
140+ // App provides a way to demux (decontainerize) and mux (containerize) media.
141141function demux (input ) { ... }
142142function mux (audio , video ) { ... }
143143const input = ... ;
@@ -170,10 +170,10 @@ const output = mux(audioOut, videoOut);
170170``` javascript
171171// The app provides sources of audio and video, perhaps from getUserMedia.
172172const {audioTrack , videoTrack } = ... ;
173- // The app also provides ways to send audio and video frames .
173+ // The app also provides ways to send encoded audio and video bitstream .
174174function sendMedia (encodedAudio , encodedVideo ) { ... };
175175
176- // First, the tracks are converted to ReadableStreams of encoded audio and video .
176+ // First, the tracks are converted to ReadableStreams of framed bitstream chunks .
177177const audio = (new AudioTrackReader (audioTrack)).readable ;
178178const video = (new VideoTrackReader (videoTrack)).readable ;
179179
@@ -209,7 +209,7 @@ const audioWriter = new AudioTrackWriter();
209209videoElem .srcObject = new MediaStream ([audioWriter .track , videoWriter .track ]);
210210
211211// Finally the decoders are created and the encoded media is piped through the decoder
212- // and into the TrackerWriters which conver them into MediaStreamTracks
212+ // and into the TrackerWriters which converts them into MediaStreamTracks.
213213const audioDecoder = new AudioDecoder ({codec: ' opus' });
214214const videoDecoder = new VideoDecoder ({codec: ' vp8' });
215215encodedAudio .pipeThrough (audioDecoder).pipeTo (audioWriter .writable );
0 commit comments