File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ npm run rebuild
1414Download and extract audio files to ` /public ` directory
1515
1616```
17- wget https://github.com/mozilla/DeepSpeech/releases/download/v0.7 .0/audio-0.7 .0.tar.gz
18- tar xfvz audio-0.7 .0.tar.gz -C ./public/
17+ wget https://github.com/mozilla/DeepSpeech/releases/download/v0.8 .0/audio-0.8 .0.tar.gz
18+ tar xfvz audio-0.8 .0.tar.gz -C ./public/
1919```
2020
2121(Optional) Download or softlink DeepSpeech 0.8.0 model files to the root of the project:
Original file line number Diff line number Diff line change @@ -68,11 +68,20 @@ function createWindow(model) {
6868 return new Promise ( function ( resolve , reject ) {
6969 try {
7070 let audioPath = path . resolve ( __dirname , 'audio' ) ;
71- fs . readdir ( audioPath , function ( err , files ) {
72- files = files . filter ( function ( file ) {
73- return file . endsWith ( '.wav' ) ;
74- } ) ;
75- resolve ( files ) ;
71+ fs . exists ( audioPath , function ( exists ) {
72+ if ( exists ) {
73+ fs . readdir ( audioPath , function ( err , files ) {
74+ files = files . filter ( function ( file ) {
75+ return file . endsWith ( '.wav' ) ;
76+ } ) ;
77+ resolve ( files ) ;
78+ } ) ;
79+ }
80+ else {
81+ console . log ( 'audio files path does not exist: ' , audioPath ) ;
82+ console . log ( 'See Readme.md' ) ;
83+ process . exit ( ) ;
84+ }
7685 } ) ;
7786 } catch ( e ) {
7887 reject ( e . toString ( ) )
You can’t perform that action at this time.
0 commit comments