MMM-Assistant
MMM-Assistant copied to clipboard
Use a ramdisk for the TTS tmp files
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()
}