synesthesiam / voice2json

Command-line tools for speech and intent recognition on Linux
MIT License
1.08k stars 63 forks source link

Can't open temp files #71

Open beto-aveiga opened 2 years ago

beto-aveiga commented 2 years ago

Hi! This issue is weird and I don't know where to begin.

The problem is that voice2json can't read temporary files.

This might be not an issue of voice2json but I just don't have a clue.

I run voice2json through docker. I'm using ubuntu 21.

In the graphic below I first run aplay with the audio file and works, then I run voice2json and it can't find the file.

image

If the audio file is in my home directory, the file is played 🤷🏼

I set the permissions for the audio file to 777, but that didn't work either.

Any help is welcome.

Thanks for your great work, voice2json is awesome.

synesthesiam commented 2 years ago

You're welcome! This is a Docker issue. I think you have to pass --tmpfs /tmp to the docker run command, otherwise it creates it's own private copy of /tmp.

beto-aveiga commented 2 years ago

You were right on the issue, however, this is what worked for me:

docker run -i \
       --init \
       -v /tmp:/tmp  \
       -v "${HOME}:${HOME}" \
       -v "/dev/shm/:/dev/shm/" \
       -w "$(pwd)" \
       -e "HOME=${HOME}" \
       --user "$(id -u):$(id -g)" \
       synesthesiam/voice2json "$@"

Notice the -v /tmp:/tmp.

It happened to me first when I tried the recipe launch_program. Do you think this should be fixed on the docs? Or in the recipe? If it is just updating the docs, I can create a PR if it makes sense.

Thanks!

synesthesiam commented 2 years ago

Sure, I'd appreciate a PR :+1: Thanks!