Commit ad25811 Mateusz Kopciński
committed
1 parent d9b5893 commit ad25811 Copy full SHA for ad25811
File tree 2 files changed +9
-9
lines changed
examples/speech-to-text/screens
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ const styles = StyleSheet.create({
234
234
flex : 1 ,
235
235
justifyContent : 'center' ,
236
236
alignItems : 'center' ,
237
- marginBottom : 100 ,
237
+ marginBottom : 20 ,
238
238
} ,
239
239
recordingButtonWrapper : {
240
240
flex : 1 ,
@@ -267,8 +267,8 @@ const styles = StyleSheet.create({
267
267
fontWeight : '600' ,
268
268
} ,
269
269
transcriptionContainer : {
270
- flex : 9 ,
271
- paddingTop : 100 ,
270
+ flex : 5 ,
271
+ paddingTop : 80 ,
272
272
width : '90%' ,
273
273
} ,
274
274
transcriptionText : {
Original file line number Diff line number Diff line change @@ -249,6 +249,12 @@ export class SpeechToTextController {
249
249
this . decodedTranscribeCallback ( prevseq ) ;
250
250
}
251
251
}
252
+ if ( this . chunks . length == 1 ) {
253
+ final_seq = seq ;
254
+ this . sequence = final_seq ;
255
+ this . decodedTranscribeCallback ( final_seq ) ;
256
+ break ;
257
+ }
252
258
// remove sos/eos token and 3 additional ones
253
259
if ( seqs . length === 0 ) {
254
260
seqs = [ seq . slice ( 0 , - 4 ) ] ;
@@ -260,12 +266,6 @@ export class SpeechToTextController {
260
266
} else {
261
267
seqs = [ ...seqs , seq . slice ( 4 , - 4 ) ] ;
262
268
}
263
- if ( this . chunks . length == 1 ) {
264
- final_seq = seqs [ 0 ] ! ;
265
- this . sequence = final_seq ;
266
- this . decodedTranscribeCallback ( final_seq ) ;
267
- break ;
268
- }
269
269
if ( seqs . length < 2 ) {
270
270
continue ;
271
271
}
You can’t perform that action at this time.
0 commit comments