Skip to content

Commit

Permalink
[voicevox] Addy DEFAULT SPEAKER ID
Browse files Browse the repository at this point in the history
  • Loading branch information
iory committed Apr 18, 2022
1 parent 3153fbb commit 18af5b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 3rdparty/voicevox/bin/text2wave
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ name_to_speaker_id = {
}


DEFAULT_SPEAKER_ID = '1'
DEFAULT_SPEAKER_ID = os.environ.get(
'VOICEVOX_DEFAULT_SPEAKER_ID', '2')
if not DEFAULT_SPEAKER_ID.isdigit():
DEFAULT_SPEAKER_ID = name_to_speaker_id[DEFAULT_SPEAKER_ID]
VOICEVOX_TEXTTOSPEECH_URL = os.environ.get(
'VOICEVOX_TEXTTOSPEECH_URL', 'localhost')
VOICEVOX_TEXTTOSPEECH_PORT = os.environ.get(
Expand All @@ -55,9 +58,6 @@ def determine_voice_name(voice_name):
.format(speaker_id_to_name[DEFAULT_SPEAKER_ID]))
speaker_id = DEFAULT_SPEAKER_ID
else:
voice_name = voice_name.replace('ー', '-')
print(voice_name)
print(name_to_speaker_id.keys())
candidates = list(filter(
lambda name: name.startswith(voice_name),
name_to_speaker_id))
Expand Down
3 changes: 3 additions & 0 deletions 3rdparty/voicevox/launch/voicevox_texttospeech.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<arg name="device" default="" />
<arg name="sound_play_respawn" default="true"
doc="Respawn sound_play node or not (default: true)" />
<arg name="default_speaker" default="四国めたん-ノーマル"
doc="Default speaker for VOICEVOX" />

<node name="voicevox_server"
pkg="voicevox" type="server.py"
Expand All @@ -16,6 +18,7 @@
output="screen" >
<remap from="robotsound" to="robotsound_jp"/>
<remap from="sound_play" to="robotsound_jp"/>
<env name="VOICEVOX_DEFAULT_SPEAKER_ID" value="$(arg default_speaker)" />
<env name="PATH" value="$(find voicevox)/bin:$(env PATH)" />
<env name="PYTHONIOENCODING" value="utf-8" />
</node>
Expand Down

0 comments on commit 18af5b7

Please sign in to comment.