File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ extension RoomPreConnect on Room {
2626 Duration timeout = const Duration (seconds: 10 ),
2727 PreConnectOnError ? onError,
2828 }) async {
29+ preConnectAudioBuffer.setErrorHandler (onError);
2930 await preConnectAudioBuffer.startRecording (timeout: timeout);
3031 try {
3132 final result = await operation ();
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class PreConnectAudioBuffer {
5353 EventChannel ? _eventChannel;
5454 StreamSubscription ? _streamSubscription;
5555
56- final PreConnectOnError ? _onError;
56+ PreConnectOnError ? _onError;
5757 final int _requestSampleRate;
5858 int ? _renderedSampleRate;
5959
@@ -301,4 +301,9 @@ class PreConnectAudioBuffer {
301301 logger.info (
302302 '[Preconnect audio] sent ${(data .length / 1024 ).toStringAsFixed (1 )}KB of audio (${secondsOfAudio .toStringAsFixed (2 )} seconds) to ${agents } agent(s)' );
303303 }
304+
305+ /// Updates the callback invoked when pre-connect audio fails.
306+ void setErrorHandler (PreConnectOnError ? onError) {
307+ _onError = onError;
308+ }
304309}
You can’t perform that action at this time.
0 commit comments