File tree 4 files changed +18
-11
lines changed
4 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @picovoice/leopard-react" ,
3
- "version" : " 2.0.2 " ,
3
+ "version" : " 2.0.3 " ,
4
4
"description" : " React hook for Leopard Web SDK" ,
5
5
"entry" : " src/index.ts" ,
6
6
"module" : " dist/esm/index.js" ,
Original file line number Diff line number Diff line change @@ -90,10 +90,17 @@ export const useLeopard = (): {
90
90
return ;
91
91
}
92
92
93
- const processResult = await leopardRef . current . process ( pcm , {
94
- transfer : true ,
95
- } ) ;
96
- setResult ( processResult ) ;
93
+ if ( pcm . length == 0 ) {
94
+ setResult ( {
95
+ transcript : "" ,
96
+ words : [ ]
97
+ } ) ;
98
+ } else {
99
+ const processResult = await leopardRef . current . process ( pcm , {
100
+ transfer : true ,
101
+ } ) ;
102
+ setResult ( processResult ) ;
103
+ }
97
104
} catch ( e : any ) {
98
105
setError ( e ) ;
99
106
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " leopard-react-demo" ,
3
- "version" : " 2.0.1 " ,
3
+ "version" : " 2.0.2 " ,
4
4
"private" : true ,
5
5
"description" : " Leopard React demo (made with Create React App)" ,
6
6
"dependencies" : {
7
- "@picovoice/leopard-react" : " =2.0.2 " ,
7
+ "@picovoice/leopard-react" : " =2.0.3 " ,
8
8
"@picovoice/web-voice-processor" : " ~4.0.8" ,
9
9
"@types/node" : " ^18.11.9" ,
10
10
"@types/react" : " ^19.0.0" ,
Original file line number Diff line number Diff line change 1759
1759
" @nodelib/fs.scandir" " 2.1.5"
1760
1760
fastq "^1.6.0"
1761
1761
1762
- " @picovoice/leopard-react@=2.0.2 " :
1763
- version "2.0.2 "
1764
- resolved "https://registry.yarnpkg.com/@picovoice/leopard-react/-/leopard-react-2.0.2 .tgz#9bd78b85c837039ae17cf14e1a5dbb3b4da25eb6 "
1765
- integrity sha512-UxbgXK49SeJ6jmSGsitFJtG3tiKm7N6v86D2UiWjwDN+RIrAu7pC9DpO5TZtFdl99hiCu7Ju/dCkC11GS6rwGg ==
1762
+ " @picovoice/leopard-react@=2.0.3 " :
1763
+ version "2.0.3 "
1764
+ resolved "https://registry.yarnpkg.com/@picovoice/leopard-react/-/leopard-react-2.0.3 .tgz#b67d95ce22ae7cf1135fc121e080675825a3a119 "
1765
+ integrity sha512-iPjSq0R1Crx9iT+ykb/Uk/rPc5o/F3MAplOQPOlQ6BC/PaJI2QA688i9x8LgQuvgxDIWnfh0+WCnByI4nXkl6A ==
1766
1766
dependencies :
1767
1767
" @picovoice/leopard-web" " =2.0.1"
1768
1768
You can’t perform that action at this time.
0 commit comments