previewing samples in order

#8
by dumnone - opened

git-lfs option for cloning helps speed things up, appreciate that. Still gets me the samples.

Here's a python script that renames sample files for multispeaker models, for review and comparison in ordered playback in some media players:

import os

directory = "/example/path/to/piper-voices/en/en_US/libritts_r/medium/samples"  # Update with your samples directory

for file in os.listdir(directory):
    if file.startswith("speaker_") and file.endswith(".mp3"):
        parts = file.split('_')[1].split('.')
        num = parts[0]
        new_num = f"{int(num):03}"  # Ensure the number is at least 3 digits
        new_file = f"speaker_{new_num}.mp3"
        if new_file != file:
            os.rename(os.path.join(directory, file), os.path.join(directory, new_file))

Sign up or log in to comment