File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export function RepoCard({
5555 const unstagedCount = gitStatus ?. files . filter ( ( f ) => ! f . staged ) . length || 0 ;
5656
5757 const handleCardClick = ( ) => {
58- if ( isReady && ! showSourceControl ) {
58+ if ( isReady && ! showSourceControl && ! showDownloadDialog ) {
5959 navigate ( `/repos/${ repo . id } ` ) ;
6060 }
6161 } ;
Original file line number Diff line number Diff line change @@ -166,6 +166,8 @@ export function useSTT(userId = 'default') {
166166 audioRecorder . current = new AudioRecorder ( )
167167 }
168168
169+ audioRecorder . current . warmup ( )
170+
169171 setupAudioRecorder ( audioRecorder . current )
170172
171173 return ( ) => {
Original file line number Diff line number Diff line change @@ -53,6 +53,26 @@ export class AudioRecorder {
5353 )
5454 }
5555
56+ async warmup ( ) : Promise < boolean > {
57+ if ( ! AudioRecorder . isSupported ( ) ) {
58+ return false
59+ }
60+
61+ try {
62+ const stream = await navigator . mediaDevices . getUserMedia ( {
63+ audio : {
64+ echoCancellation : true ,
65+ noiseSuppression : true ,
66+ autoGainControl : true ,
67+ } ,
68+ } )
69+ stream . getTracks ( ) . forEach ( track => track . stop ( ) )
70+ return true
71+ } catch {
72+ return false
73+ }
74+ }
75+
5676 getState ( ) : AudioRecorderState {
5777 return this . state
5878 }
@@ -186,3 +206,8 @@ export function getAudioRecorder(): AudioRecorder {
186206export function isAudioRecordingSupported ( ) : boolean {
187207 return AudioRecorder . isSupported ( )
188208}
209+
210+ export async function warmupAudioRecorder ( ) : Promise < boolean > {
211+ const recorder = getAudioRecorder ( )
212+ return recorder . warmup ( )
213+ }
You can’t perform that action at this time.
0 commit comments