File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Scripts/Services/SpeechToText/v1 Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1298,7 +1298,6 @@ private SpeechRecognitionEvent ParseRecognizeResponse(IDictionary resp)
1298
1298
if ( ialternative . Contains ( "word_confidence" ) )
1299
1299
{
1300
1300
IList iconfidence = ialternative [ "word_confidence" ] as IList ;
1301
-
1302
1301
WordConfidence [ ] confidence = new WordConfidence [ iconfidence . Count ] ;
1303
1302
for ( int i = 0 ; i < iconfidence . Count ; ++ i )
1304
1303
{
@@ -1308,7 +1307,9 @@ private SpeechRecognitionEvent ParseRecognizeResponse(IDictionary resp)
1308
1307
1309
1308
WordConfidence wc = new WordConfidence ( ) ;
1310
1309
wc . Word = ( string ) iwordconf [ 0 ] ;
1311
- wc . Confidence = ( double ) iwordconf [ 1 ] ;
1310
+ string wordConf = iwordconf [ 1 ] . ToString ( ) ;
1311
+ double . TryParse ( wordConf , out double wordConfDouble ) ;
1312
+ wc . Confidence = wordConfDouble ;
1312
1313
confidence [ i ] = wc ;
1313
1314
}
1314
1315
You can’t perform that action at this time.
0 commit comments