Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "This is a Bash loop for converting .opus files to .mp3."
- # Create the output directory if it doesn't exist
- mkdir -p outputs
- # Check if there are any .opus files
- shopt -s nullglob
- opus_files=(*.opus)
- if [ ${#opus_files[@]} -eq 0 ]; then
- echo "No .opus files found in this directory."
- exit 1
- fi
- # Loop through each .opus file
- for f in "${opus_files[@]}"; do
- echo "Converting '$f' to MP3..."
- ffmpeg -i "$f" -c:a libmp3lame "outputs/${f%.opus}.mp3"
- echo "Finished '$f'."
- done
- echo "All conversions completed!"
Advertisement
Add Comment
Please, Sign In to add comment