E3V3A / TESTT

TEST -- This is only a test repo - nothing here
0 stars 0 forks source link

Use a ramdisk for the TTS tmp files #35

Open E3V3A opened 6 years ago

E3V3A commented 6 years ago

Consider using a ramdisk for the temporary files created in /tmp to store pico2wav files used in the text-to-speech function, in node_helper.js. This would help save SD card based devices from over-wear.

    var commandTmpl = 'pico2wave -l "{{lang}}" -w {{file}} "{{text}}" && aplay {{file}}'

    function getTmpFile() {
        var random = Math.random().toString(36).slice(2),
        path = '/tmp/' + random + '.wav'
        return (!fs.existsSync(path)) ? path : getTmpFile()
    }