matatonic / openedai-speech

An OpenAI API compatible text to speech server using Coqui AI's xtts_v2 and/or piper tts as the backend.
GNU Affero General Public License v3.0
193 stars 32 forks source link

Custom piper voice generates empty mp3 #27

Closed nocaremc closed 3 weeks ago

nocaremc commented 3 weeks ago

I trained a onnx model with piper. Tested and working well. When adding to openedai-speech as a speaker, I just get an empty mp3

voice_to_speaker.yml

nocare:
    model: voices/en_US-nocare-medium.onnx
    speaker: # default

image

curl http://localhost:8000/v1/audio/speech -H "Content-Type: application/json" -d '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "nocare",
    "response_format": "mp3",
    "speed": 1.0
  }' > speech.mp3

I'm using the non-gpu docker image and I'm not really sure where I can find any kind of log output. Any help is appreciated

matatonic commented 3 weeks ago

you can see the logs with docker compose logs -f (depending on how you started the server. You can also try letting the output go to the console, like so:

curl http://localhost:8000/v1/audio/speech -H "Content-Type: application/json" -d '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "nocare",
    "response_format": "mp3",
    "speed": 1.0
  }'

It may print any error message received. Nothing at all back is odd...

nocaremc commented 3 weeks ago

Oh I see. I was trying to look around the filesystem for logs.

Here we go, silly problem solved. FileNotFoundError: [Errno 2] No such file or directory: 'voices/en_US-nocare-medium.onnx.json'

Thanks!

matatonic commented 3 weeks ago

You're not the first to hit this, I should add a note about the json files being required for custom voices - thanks!

nocaremc commented 3 weeks ago

I had the json file, I just had it as .json and not .onnx.json