Skip to content

fix(tts): text_to_speech.py __main__ block passes a max_accelerate_audio kwarg that no longer exists - #205

Open
Anai-Guo wants to merge 1 commit into
R3gm:mainfrom
Anai-Guo:fix-tts-main-block-stale-kwarg
Open

fix(tts): text_to_speech.py __main__ block passes a max_accelerate_audio kwarg that no longer exists#205
Anai-Guo wants to merge 1 commit into
R3gm:mainfrom
Anai-Guo:fix-tts-main-block-stale-kwarg

Conversation

@Anai-Guo

Copy link
Copy Markdown

Problem

Running soni_translate/text_to_speech.py directly fails immediately:

if __name__ == "__main__":
    from segments import result_diarize

    audio_segmentation_to_voice(
        result_diarize,
        TRANSLATE_AUDIO_TO="en",
        max_accelerate_audio=2.1,        # <-- not a parameter of this function
        is_gui=True,
        ...
    )
TypeError: audio_segmentation_to_voice() got an unexpected keyword argument 'max_accelerate_audio'

Why the kwarg is the stale side

max_accelerate_audio is a parameter of accelerate_segments() (text_to_speech.py:1089-1091,
used at :1162-1163 to clamp acc_percentage), not of audio_segmentation_to_voice()
(:969, whose parameters are result_diarize, TRANSLATE_AUDIO_TO, is_gui, tts_voice00..11, dereverb_automatic, model_id_bark, model_id_coqui, delete_previous_automatic).

The pipeline in app_rvc.py reflects that split: it passes max_accelerate_audio to
accelerate_segments (app_rvc.py:989-994) and calls audio_segmentation_to_voice
positionally with only the 15 arguments it actually declares (app_rvc.py:955-970). The
__main__ block is the only call site that still hands acceleration to the TTS function.

Fix

Delete that one argument. Nothing else in the block changes, and no non-__main__ code path
is touched.

Verification

Extracted the real signature with ast and replayed both call sites with
inspect.Signature.bind:

signature: (result_diarize, TRANSLATE_AUDIO_TO, is_gui, tts_voice00, tts_voice01=None, ...,
            dereverb_automatic=None, model_id_bark=None, model_id_coqui=None,
            delete_previous_automatic=None)

--- __main__ block as written (text_to_speech.py:1566) ---
TypeError: got an unexpected keyword argument 'max_accelerate_audio'

--- __main__ block patched ---
binds OK

--- control group: app_rvc.py:955 (15 positional) ---
binds OK

🤖 Generated with Claude Code

… smoke test

audio_segmentation_to_voice() does not take max_accelerate_audio - that
parameter belongs to accelerate_segments(). Running text_to_speech.py directly
raises TypeError before any TTS work happens.
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

Successfully merging this pull request may close these issues.

1 participant