Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request : img2audio batch convert. #6

Open
wedgeewoo opened this issue Dec 22, 2022 · 3 comments
Open

Feature Request : img2audio batch convert. #6

wedgeewoo opened this issue Dec 22, 2022 · 3 comments

Comments

@wedgeewoo
Copy link

Rendering each file in a directory would make it easier for those with potato video cards.

@HIN0209
Copy link

HIN0209 commented Jan 21, 2023

Hi, using Jupyter lab, I was successful converting in a batch manner with the code below. All the wav files in the input_dir are converted to 5-second spectrograms.
(reference: https://github.com/thx-pw/riffusion-music2music-colab)

output = "./content/input/spectrogram"
input_dir = "./content/input/wav_clip"

with os.scandir(input_dir) as dirs:
for entry in dirs:
!python file2img.py --input "./content/input/wav_clip/{entry.name}" --output {output} --nmels 512 --maxvol 255 --powerforimage 0.35

@HIN0209
Copy link

HIN0209 commented Jan 21, 2023

my prior code needs to be adjusted for indents for the last two lines, obviously.

@lalalune
Copy link

Here is a shell script you can run

wavDir=data
imgDir=data_out

for wav in $wavDir/*.wav
do
    img=$imgDir
    python3 file2img.py -i $wav -o $img
done

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

No branches or pull requests

3 participants