File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
examples/speech-to-text/screens Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -78,18 +78,18 @@ export const SpeechToTextScreen = () => {
7878 const onChunk = ( data : string ) => {
7979 const float32Chunk = float32ArrayFromPCMBinaryBuffer ( data ) ;
8080 audioBuffer . current ?. push ( ...float32Chunk ) ;
81- streamingTranscribe ( audioBuffer . current , STREAMING_ACTION . DATA ) ;
81+ streamingTranscribe ( float32Chunk , STREAMING_ACTION . DATA ) ;
8282 } ;
8383
8484 const handleRecordPress = async ( ) => {
8585 if ( isRecording ) {
8686 LiveAudioStream . stop ( ) ;
8787 setIsRecording ( false ) ;
88- await streamingTranscribe ( audioBuffer . current , STREAMING_ACTION . STOP ) ;
88+ await streamingTranscribe ( [ ] , STREAMING_ACTION . STOP ) ;
8989 audioBuffer . current = [ ] ;
9090 } else {
9191 setIsRecording ( true ) ;
92- streamingTranscribe ( audioBuffer . current , STREAMING_ACTION . START ) ;
92+ streamingTranscribe ( [ ] , STREAMING_ACTION . START ) ;
9393 startStreamingAudio ( audioStreamOptions , onChunk ) ;
9494 }
9595 } ;
@@ -184,7 +184,7 @@ export const SpeechToTextScreen = () => {
184184 ] }
185185 >
186186 < TouchableOpacity
187- disabled = { recordingButtonDisabled || isGenerating }
187+ disabled = { recordingButtonDisabled }
188188 style = { [
189189 styles . recordingButton ,
190190 recordingButtonDisabled && styles . backgroundGrey ,
Original file line number Diff line number Diff line change @@ -34,3 +34,4 @@ export * from './types/image_segmentation';
3434
3535// constants
3636export * from './constants/modelUrls' ;
37+ export { STREAMING_ACTION } from './constants/sttDefaults' ;
You can’t perform that action at this time.
0 commit comments