Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: PiperVoice.__init__() missing 1 required positional argument: 'config' #614

Open
ghost opened this issue Sep 25, 2024 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 25, 2024

When trying to initialize the model, I get the following error message:

Traceback (most recent call last):
File "/home/jedd/jarvis/jv.py", line 19, in
voice = PiperVoice(model)
^^^^^^^^^^^^^^^^^
TypeError: PiperVoice.init() missing 1 required positional argument: 'config'

Raspberry Pi 5 - 8GB
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian

Model Files
en_US-lessac-medium.onnx
en_US-lessac-medium.onnx.json

en_US-lessac-medium.onnx.json

import os
from dotenv import load_dotenv
import time
import speech_recognition as sr
import pyttsx3
from piper.voice import PiperVoice
import numpy as np
import sounddevice as sd

load_dotenv()
model = "/home/jedd/jarvis/en_US-lessac-medium.onnx.json"
voice = PiperVoice(model)
text = "This is an example of text to speech"
wav_file = wave.open(“output.wav”, “w”)
audio = voice.synthesize(text, wav_file)
@ghost
Copy link
Author

ghost commented Sep 25, 2024

the PiperVoice(model) syntax is wrong - it should be as follows:

PiperVoice.load(model)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants