minor update to standard voice naming.

This commit is contained in:
erew123 authored and GitHub committed 2023-12-25 21:53:40 +00:00
1 parent be9862d0b0
commit 5bed68a963
1 file changed
+10 -5
+10 -5
View File
@@ -501,7 +501,7 @@ def output_modifier(string, state):
if process_lock.acquire(blocking=False): if process_lock.acquire(blocking=False):
try: try:
if params["narrator_enabled"]: if params["narrator_enabled"]:
# print(original_string) #print(original_string)
# Do Some basic stripping and remove any double CR's # Do Some basic stripping and remove any double CR's
processed_string = ( processed_string = (
original_string original_string
@@ -522,11 +522,11 @@ def output_modifier(string, state):
.replace('"', '&quot;<') .replace('"', '&quot;<')
) )
#capturing another outlier in inital character paragraph #capturing another outlier in inital character paragraph
# print("processed string 1 is:", processed_string) #print("processed string 1 is:", processed_string)
processed_string = processed_string.replace('&quot;<. *', '&quot;< *"') processed_string = processed_string.replace('&quot;<. *', '&quot;< *"')
processed_string = processed_string.replace('< *"', '< *') processed_string = processed_string.replace('< *"', '< *')
processed_string = processed_string.replace('. *', '< *') processed_string = processed_string.replace('. *', '< *')
# print("processed string 2 is:", processed_string) #print("processed string 2 is:", processed_string)
# Set up a tracking of the individual wav files. # Set up a tracking of the individual wav files.
audio_files_all_paragraphs = [] audio_files_all_paragraphs = []
# Split the line using &quot; and ".* " (so end of sentences, leaving special characters added to the start of all OTHER sentences, bar possibly the first one if its starting with a * # Split the line using &quot; and ".* " (so end of sentences, leaving special characters added to the start of all OTHER sentences, bar possibly the first one if its starting with a *
@@ -576,9 +576,14 @@ def output_modifier(string, state):
) )
cleaned_part = html.unescape(processed_string) cleaned_part = html.unescape(processed_string)
# Process the part and give it a non-character name if being used vai API or standalone. # Process the part and give it a non-character name if being used vai API or standalone.
output_filename = get_output_filename(state) if "character_menu" in state:
output_file = Path(f'{params["output_folder_wav"]}/{state["character_menu"]}_{int(time.time())}.wav')
else:
output_file = Path(f'{params["output_folder_wav"]}/TTSOUT_{int(time.time())}.wav')
output_file_str = output_file.as_posix()
output_file = get_output_filename(state)
generate_response = send_generate_request( generate_response = send_generate_request(
cleaned_part, params["voice"], language_code, output_filename cleaned_part, params["voice"], language_code, output_file_str
) )
audio_path = generate_response.get("data", {}).get("audio_path") audio_path = generate_response.get("data", {}).get("audio_path")
final_output_file = audio_path final_output_file = audio_path