File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { parseStreamResponseType } from "./parseStreamResponseType.js";
99const STREAM_CONFIG_REJECTION_TYPES : readonly string [ ] = [
1010 Corti . StreamConfigStatusMessageType . ConfigDenied ,
1111 Corti . StreamConfigStatusMessageType . ConfigMissing ,
12- Corti . StreamConfigStatusMessageType . ConfigTimeout ,
1312 Corti . StreamConfigStatusMessageType . ConfigNotProvided ,
1413] ;
1514
@@ -126,7 +125,11 @@ export class CustomStream extends StreamClient {
126125 socket . socket . addEventListener ( "message" , ( event ) => {
127126 const type = parseStreamResponseType ( event . data ) ;
128127
129- if ( type == null || type === Corti . StreamConfigStatusMessageType . ConfigAccepted ) {
128+ if (
129+ type == null ||
130+ type === Corti . StreamConfigStatusMessageType . ConfigAccepted ||
131+ type === Corti . StreamConfigStatusMessageType . ConfigAlreadyReceived
132+ ) {
130133 return ;
131134 }
132135
@@ -158,7 +161,10 @@ export class CustomStream extends StreamClient {
158161 const type = parseStreamResponseType ( event . data ) ;
159162 if ( type == null ) return ;
160163
161- if ( type === Corti . StreamConfigStatusMessageType . ConfigAccepted ) {
164+ if (
165+ type === Corti . StreamConfigStatusMessageType . ConfigAccepted ||
166+ type === Corti . StreamConfigStatusMessageType . ConfigAlreadyReceived
167+ ) {
162168 cleanup ( ) ;
163169 resolve ( ) ;
164170 } else if ( STREAM_CONFIG_REJECTION_TYPES . includes ( type ) ) {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { parseTranscribeResponseType } from "./parseTranscribeResponseType.js";
99const TRANSCRIBE_CONFIG_REJECTION_TYPES : readonly string [ ] = [
1010 Corti . TranscribeConfigStatusMessageType . ConfigDenied ,
1111 Corti . TranscribeConfigStatusMessageType . ConfigTimeout ,
12+ Corti . TranscribeConfigStatusMessageType . ConfigMissing ,
1213] ;
1314
1415export type CustomTranscribeConnectArgs = {
@@ -123,7 +124,11 @@ export class CustomTranscribe extends TranscribeClient {
123124 socket . socket . addEventListener ( "message" , ( event ) => {
124125 const type = parseTranscribeResponseType ( event . data ) ;
125126
126- if ( type == null || type === Corti . TranscribeConfigStatusMessageType . ConfigAccepted ) {
127+ if (
128+ type == null ||
129+ type === Corti . TranscribeConfigStatusMessageType . ConfigAccepted ||
130+ type === Corti . TranscribeConfigStatusMessageType . ConfigAlreadyReceived
131+ ) {
127132 return ;
128133 }
129134
@@ -155,7 +160,10 @@ export class CustomTranscribe extends TranscribeClient {
155160 const type = parseTranscribeResponseType ( event . data ) ;
156161 if ( type == null ) return ;
157162
158- if ( type === Corti . TranscribeConfigStatusMessageType . ConfigAccepted ) {
163+ if (
164+ type === Corti . TranscribeConfigStatusMessageType . ConfigAccepted ||
165+ type === Corti . TranscribeConfigStatusMessageType . ConfigAlreadyReceived
166+ ) {
159167 cleanup ( ) ;
160168 resolve ( ) ;
161169 } else if ( TRANSCRIBE_CONFIG_REJECTION_TYPES . includes ( type ) ) {
You can’t perform that action at this time.
0 commit comments