Skip to content

vllm_omni.diffusion.models.soulx_singer.modules.preprocess.utils

Shared helpers for SoulX preprocess (I/O, config, checkpoints, pitch).

logger module-attribute

logger = init_logger(__name__)

boundary2Interval

boundary2Interval(bd)

denorm_f0

denorm_f0(
    f0,
    uv,
    pitch_norm="log",
    f0_mean=400,
    f0_std=100,
    pitch_padding=None,
    min=50,
    max=900,
)

f0_to_coarse

f0_to_coarse(f0, f0_bin=256, f0_max=900.0, f0_min=50.0)

get_audio_duration

get_audio_duration(path: str) -> float

Return audio duration in seconds for a file on disk.

load_model_ckpt

load_model_ckpt(
    model: Module,
    checkpoint_path: str,
    *,
    model_name: str = "model",
    verbose: bool = True,
) -> None

load_mono_audio

load_mono_audio(
    source: str | tuple[ndarray, int],
    *,
    target_sr: int | None = None,
) -> tuple[ndarray, int]

load_rosvot_config

load_rosvot_config(
    config: str | Path, *, hparams_str: str = ""
) -> dict[str, Any]

load_yaml_config

load_yaml_config(
    config: str | Path, *, hparams_str: str = ""
) -> dict[str, Any]

Load YAML with optional base_config chain; returns a plain dict.

norm_f0

norm_f0(f0, uv, pitch_norm='log', f0_mean=400, f0_std=100)

norm_interp_f0

norm_interp_f0(
    f0, pitch_norm="log", f0_mean=None, f0_std=None
)

pad_or_cut_xd

pad_or_cut_xd(
    values: Tensor, tgt_len: int, dim: int = -1, pad_value=0
) -> Tensor

resample_mono

resample_mono(
    audio: ndarray, *, orig_sr: int, target_sr: int
) -> ndarray

Resample mono float waveform to target_sr.