diff --git a/js/worker.js b/js/worker.js index 765b8aa..9551ec8 100644 --- a/js/worker.js +++ b/js/worker.js @@ -109,7 +109,6 @@ Date.prototype.getWeekNumber = function(){ const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path.replace('app.asar', 'app.asar.unpacked'); -//ffmpeg.setFfmpegPath(staticFfmpeg.path.replace('app.asar', 'app.asar.unpacked')); ffmpeg.setFfmpegPath(ffmpegPath); let predictionsRequested = {}, predictionsReceived = {}, filesBeingProcessed = []; let diskDB, memoryDB; @@ -1327,7 +1326,7 @@ const getPredictBuffers = async ({ }) => { if (! fs.existsSync(file)) { const found = await getWorkingFile(file); - if (!found) return + if (!found) throw new Error('Unable to locate ' + file); } // Ensure max and min are within range start = Math.max(0, start); @@ -1407,6 +1406,7 @@ async function processAudio (file, start, end, chunkStart, highWaterMark, sample STREAM.on('end', () => { // Handle any remaining data in the buffer if (currentIndex > 0) { // Check if there's any data left in the buffer + AUDIO_BACKLOG++; prepareWavForModel(audioBuffer.subarray(0, currentIndex), file, end, chunkStart); feedChunksToModel(...predictQueue.shift()); } @@ -1470,8 +1470,9 @@ const fetchAudioBuffer = async ({ file = '', start = 0, end = undefined }) => { if (! fs.existsSync(file)) { - file = await getWorkingFile(file); - if (!file) throw new Error('Cannot locate ' + file); + const result = await getWorkingFile(file); + if (!result) throw new Error('Cannot locate ' + file); + else file = result; } METADATA[file]?.duration || await setMetadata({file:file}); end ??= METADATA[file].duration; @@ -2227,8 +2228,8 @@ async function processNextFile({ if (FILE_QUEUE.length) { let file = FILE_QUEUE.shift() const found = await getWorkingFile(file).catch(error => { - console.warn('Error in getWorkingFile', error); - generateAlert({type: 'warning', message: error.message}) + console.warn('Can\'t locate: ', file); + generateAlert({type: 'warning', message: 'Cannot locate: ' + file}) }); if (found) { if (end) {} diff --git a/package.json b/package.json index 0f6a382..82f4799 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,16 @@ { "name": "chirpity", - "version": "2.2.6", + "version": "2.3.0", "description": "Chirpity Nocmig", "main": "main.js", "scripts": { "start": "electron .", "prebuild": "node prebuild.js", "preexport": "node prebuild.js", + "preAppImage": "node prebuild.js", "minify": "node minify.js", - "export": "electron-builder build --linux --x64 --m", + "export": "electron-builder build --m", + "AppImage": "electron-builder build --linux --x64", "build": "electron-builder --win --x64 -p always", "postinstall": "electron-builder install-app-deps" },