#!/bin/bash

# Directory containing the MP3 files
input_directory="/app/suno/christian/data/trending-05062024"
# Directory to save the converted WAV files
output_directory="/app/suno/christian/data/trending-05062024-wav"

mkdir -p "$output_directory"

for file in "$input_directory"/*.mp3; do
  # Get the base name of the file
  base_name=$(basename "$file" .wav)
  # Convert and resample to 24 kHz WAV
  ffmpeg -i "$file" -ar 48000 "$output_directory/$base_name.wav"
done
