piper icon indicating copy to clipboard operation
piper copied to clipboard

Multiple sound synthesis after a single loading of the model

Open lessenko opened this issue 2 years ago • 1 comments

Hi, Is it possible to do multiple sound synthesis after a single loading of the model? The following example produces an error: onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION: Non-zero status code returned while running Reshape node.

Example:

_tmp = "Hello, World!"
voice = PiperVoice.load(model_e_ryan)

stream = sd.OutputStream(samplerate=voice.config.sample_rate, channels=1, dtype='int16')
stream.start()
for audio_bytes in voice.synthesize_stream_raw(tmp):
    int_data = np.frombuffer(audio_bytes, dtype=np.int16)
    stream.write(int_data)
stream.stop()
stream.close()

stream = sd.OutputStream(samplerate=voice.config.sample_rate, channels=1, dtype='int16')
stream.start()
for audio_bytes in voice.synthesize_stream_raw(tmp):
    int_data = np.frombuffer(audio_bytes, dtype=np.int16)
    stream.write(int_data)
stream.stop()
stream.close()_

Thanks.

lessenko avatar Aug 17 '24 08:08 lessenko

It is fixed as in https://github.com/rhasspy/piper/issues/552 in comments by tebbbb. It is used folowing:

pip install -U piper-phonemize pip install onnxruntime==1.17.1

Thanks.

lessenko avatar Aug 18 '24 12:08 lessenko