Mycroft Community Forum

Mimic's audio files location


I would like to keep a record of Mycroft’s tts answers and I’m wondering if Mycroft has some tmp folder where it stores the tts output, or is it synthesized in real time?

Is there a command that would allow me to save tts output as audio in a specific directory every time Mycroft utters?


Look in /tmp/mycroft, there’s a cache of recent tts items usually.

1 Like

if you want to automate that maybe the package “inotify” with the command inotifywait is something for you

It will be part of a bigger Python script so I’ve already implemented Watchdog. Didn’t know of inotify though, thanks!

Ok I ran into a follow-up problem. Is it somehow possible to know which file Mycroft is “reading” from? Since the cache is not modified unless Mycroft says something new, I would need to somehow know when it’s reading from an already cached file, and which one.

Thanks a ton!

Check the audio.log.

1 Like

simply delete the cache and monitor it from there.

That’s what I’d normally do but there are a few more things involved. Basically if I clear the cache sometimes the file has not yet been copied, and sometimes there’s still a tts lined up to be spoken, so I want to know if the file has been both, backed up and spoken out before cleaning it.

Audio log seems to show the text which is being spoken but not which file it is reading from.

If there’s a cache hit it gets logged in audio.log file. I thought it logged the file names, but it’s an ident string instead.

1 Like

I sorted it with a fresh head this morning haha :slight_smile: I just clean the oldest files in the cache and then ones created within a close range (supposedly of the same utterance) . This is definitely not the most accurate way but if I come up with something better I will post it here.

The file names of the audio cache files are hash-values of the actual phrase. Look into mycroft-core code to see how it is done, from there you should be able to identify the files.