Fixed types and imports

This commit is contained in:
Sirshendu Ganguly
2026-04-21 10:04:11 +05:30
parent 6dcd734c46
commit dc76f4b7cf
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -97,9 +97,9 @@ class RunwareAudioInferenceSpeech:
text = (kwargs.get("text") or "").strip()
voice = (kwargs.get("voice") or "").strip()
use_voice = kwargs.get("useVoice", False)
use_speed = kwargs.get("useSpeed", True)
use_speed = kwargs.get("useSpeed", False)
speed = float(kwargs.get("speed", 1.0))
use_volume = kwargs.get("useVolume", True)
use_volume = kwargs.get("useVolume", False)
volume = float(kwargs.get("volume", 1.0))
use_pitch = kwargs.get("usePitch", False)
pitch = float(kwargs.get("pitch", 0.0))
+5 -5
View File
@@ -4,7 +4,7 @@ Builds speech.voices[] for multi-speaker audio inference speech payloads.
"""
import re
from typing import Any, Dict, List
from typing import Dict, List
class RunwareAudioInferenceSpeechVoices:
@@ -18,7 +18,7 @@ class RunwareAudioInferenceSpeechVoices:
optional_inputs = {}
for i in range(1, cls.MAX_VOICES + 1):
optional_inputs[f"useVoice{i}"] = ("BOOLEAN", {
"default": i == 1,
"default": False,
"tooltip": f"Enable to include speaker/voice pair #{i} in speech.voices.",
})
optional_inputs[f"speaker{i}"] = ("STRING", {
@@ -44,12 +44,12 @@ class RunwareAudioInferenceSpeechVoices:
"Each item contains speaker (unique alphanumeric alias) and voice name."
)
def createVoices(self, **kwargs) -> tuple[List[Dict[str, str]]]:
voices: List[Dict[str, str]] = []
def createVoices(self, **kwargs) -> tuple[list[dict[str, str]],]:
voices: list[dict[str, str]] = []
seen_speakers = set()
for i in range(1, self.MAX_VOICES + 1):
use_voice = bool(kwargs.get(f"useVoice{i}", i == 1))
use_voice = bool(kwargs.get(f"useVoice{i}", False))
if not use_voice:
continue