|
1 | 1 |
|
2 | | - FS.createPath('/', 'espeak/espeak-data', true, false); |
3 | | - [['config', config], ['phontab', phontab], ['phonindex', phonindex], ['phondata', phondata], ['intonations', intonations], ['en_dict', en_dict] /*, ['fr_dict', fr_dict] */].forEach(function(pair) { // commented-out code here is needed for French |
4 | | - var id = pair[0]; |
5 | | - var data = pair[1]; |
6 | | - FS.createDataFile('/espeak/espeak-data', id, data, true, false); |
7 | | - }); |
| 2 | + FS.ignorePermissions = true; |
8 | 3 |
|
9 | | - //FS.createPath('/', 'espeak/espeak-data/voices', true, false); // Needed for French |
10 | | - //FS.createDataFile('/espeak/espeak-data/voices', 'fr', fr, true, false); // Needed for French |
| 4 | + FS.createPath('/', 'espeak/espeak-data', true, false); |
| 5 | + [['config', config], ['phontab', phontab], ['phonindex', phonindex], ['phondata', phondata], ['intonations', intonations], ['en_dict', en_dict] /*, ['fr_dict', fr_dict] */].forEach(function(pair) { // commented-out code here is needed for French |
| 6 | + var id = pair[0]; |
| 7 | + var data = pair[1]; |
| 8 | + FS.createDataFile('/espeak/espeak-data', id, data, true, false); |
| 9 | + }); |
11 | 10 |
|
12 | | - FS.createPath('/', 'espeak/espeak-data/voices/en', true, false); |
13 | | - FS.createDataFile('/espeak/espeak-data/voices/en', 'en-us', en_us, true, false); |
| 11 | + //FS.createPath('/', 'espeak/espeak-data/voices', true, false); // Needed for French |
| 12 | + //FS.createDataFile('/espeak/espeak-data/voices', 'fr', fr, true, false); // Needed for French |
14 | 13 |
|
15 | | - FS.root.write = true; |
| 14 | + FS.createPath('/', 'espeak/espeak-data/voices/en', true, false); |
| 15 | + FS.createDataFile('/espeak/espeak-data/voices/en', 'en-us', en_us, true, false); |
| 16 | + |
| 17 | + FS.root.write = true; |
| 18 | + |
| 19 | + FS.ignorePermissions = false; |
16 | 20 |
|
17 | | - function speak(text, args) { |
18 | 21 | args = args || {}; |
19 | 22 | Module.arguments = [ | 20 | 23 | '-w', 'wav.wav', |
|
58 | 61 | return ret; |
59 | 62 | } |
60 | 63 |
|
61 | | - for (var i = 0; i < wav.length; i++) |
| 64 | + for (var i = 0; i < wav.length; i++) { |
62 | 65 | wav[i] = unSign(wav[i], 8); |
| 66 | + } |
63 | 67 |
|
64 | 68 | document.getElementById("audio").innerHTML=("<audio id=\"player\" src=\"data:audio/x-wav;base64,"+encode64(wav)+"\">"); |
65 | 69 | document.getElementById("player").play(); |
66 | 70 | } |
67 | 71 |
|
68 | | - return speak; |
69 | | -})(); |
| 72 | + this['speak'] = speak; // for closure compiler |
70 | 73 |
|
0 commit comments