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

Piper Engine "Unexpected WAV Properties: Channels=1, Rate=22050, Width=2" #250

Open
EyuphanMandiraci opened this issue Jan 13, 2025 · 2 comments

Comments

@EyuphanMandiraci
Copy link

EyuphanMandiraci commented Jan 13, 2025

Hello, i am trying to use PiperEngine
`
voice = PiperVoice(r"C:\Users\mandi\PycharmProjects\JarvisProject2.0\en_GB-alan-medium.onnx", r"C:\Users\mandi\PycharmProjects\JarvisProject2.0\en_GB-alan-medium.onnx.json")

engine = PiperEngine(r"C:\Users\mandi\Documents\piper\piper.exe", voice=voice)

stream = TextToAudioStream(engine)

stream.feed(runPrompt(prompt))

stream.play_async()
`

but it returns error

`
Unexpected WAV properties: Channels=1, Rate=22050, Width=2

WARNING:root:engine piper failed to synthesize sentence "They lived happily ever after, with only the most necessary luxuries.", unknown error

WARNING:root:engine piper is the only engine available, can't switch to another engine
`

@KoljaB
Copy link
Owner

KoljaB commented Jan 13, 2025

This is related to:
#244

I'm still new to piper and wasn't aware of other models than 16000 Hz. For now please:

  • open RealtimeTTS/engines/piper_engine.py
  • change line 77 from
 return pyaudio.paInt16, 1, 16000
 return pyaudio.paInt16, 1, 22050
  • remove lines 127-132:
    if wf.getnchannels() != 1 or wf.getframerate() != 16000 or wf.getsampwidth() != 2:
		print(f"Unexpected WAV properties: "
			f"Channels={wf.getnchannels()}, "
			f"Rate={wf.getframerate()}, "
			f"Width={wf.getsampwidth()}")
		return False

Need to make this customizable / work on the PR

@Meshwa428
Copy link

I also have same issue.
any updates?
Can i help fix it?

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

3 participants