Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
/piperPublic archive

Commite5cb84c

Browse files
authored
Merge pull request#302 from JarbasAl/patch-1
fix single speaker models speaker_id arg
2 parents2fa4c2c +d43ecbc commite5cb84c

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

‎src/python_run/piper/voice.py‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,25 +162,24 @@ def synthesize_ids_to_raw(
162162
dtype=np.float32,
163163
)
164164

165+
args= {
166+
"input":phoneme_ids_array,
167+
"input_lengths":phoneme_ids_lengths,
168+
"scales":scales
169+
}
170+
171+
ifself.config.num_speakers<=1:
172+
speaker_id=None
173+
165174
if (self.config.num_speakers>1)and (speaker_idisNone):
166175
# Default speaker
167176
speaker_id=0
168177

169-
sid=None
170-
171178
ifspeaker_idisnotNone:
172179
sid=np.array([speaker_id],dtype=np.int64)
180+
args["sid"]=sid
173181

174182
# Synthesize through Onnx
175-
audio=self.session.run(
176-
None,
177-
{
178-
"input":phoneme_ids_array,
179-
"input_lengths":phoneme_ids_lengths,
180-
"scales":scales,
181-
"sid":sid,
182-
},
183-
)[0].squeeze((0,1))
183+
audio=self.session.run(None,args, )[0].squeeze((0,1))
184184
audio=audio_float_to_int16(audio.squeeze())
185-
186185
returnaudio.tobytes()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp