Used Chatgpt to write this script to convert my roboquest wav files to flac and while preseving the meta data
I fed these two posts into the chat
It gave me this script that I could run in the cli after I prompted it to fix the filename and place the contents in a a folder called flac_files
mkdir -p flac_files; for f in *.wav; set base_name (basename "$f" .wav); ffmpeg -i "$f" -c:a flac -sample_fmt s32 -map_metadata 0 "flac_files/$base_name.flac"; end
here it is as a bash script
#!/bin/bash
# Create a directory for the converted files
mkdir -p flac_files
# Loop through all .wav files in the current directory
for f in *.wav; do
# Extract the base name without the extension
base_name=$(basename "$f" .wav)
# Convert the file to .flac with metadata preserved
ffmpeg -i "$f" -c:a flac -sample_fmt s32 -map_metadata 0 "flac_files/${base_name}.flac"
done
echo "Conversion completed! Check the 'flac_files' directory."