Skip to content
/ ra2mp3 Public

Convert RealAudio (.ra) files to MP3 format - bash script with installers for macOS and Linux

License

Notifications You must be signed in to change notification settings

wiiiimm/ra2mp3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ra2mp3

A simple bash script to convert RealAudio (.ra/.ram/.rm) files to MP3 format using FFmpeg.

πŸ“‹ For current version, release notes, and recent changes, see CHANGELOG.md

Features

  • Recursively finds and converts all .ra/.ram/.rm files (case-insensitive)
  • Preserves directory structure in the output
  • Skips files that have already been converted
  • Uses high-quality MP3 encoding (VBR quality 2)
  • Progress feedback with clear status messages

Prerequisites

  • bash (included with macOS/Linux)
  • FFmpeg with libmp3lame support (automatically installed via Homebrew, or see manual installation below)
  • macOS/Linux (Windows users can use WSL)

Installation

🍺 Homebrew Installation (Recommended for macOS/Linux)

The easiest way to install ra2mp3 is via Homebrew, which automatically installs all dependencies including FFmpeg:

# Install Homebrew if you don't have it (macOS/Linux):
# macOS: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Linux: Follow instructions at https://brew.sh

# Add the tap and install ra2mp3 (FFmpeg will be installed automatically)
brew tap wiiiimm/tap
brew install ra2mp3

# Now you can use ra2mp3 from anywhere!
ra2mp3 --help

Benefits of Homebrew installation:

  • βœ… Automatically installs FFmpeg dependency
  • βœ… Easy updates via brew upgrade ra2mp3
  • βœ… Available system-wide (no need to download scripts)
  • βœ… Managed by your package manager

Alternative Installation Methods

If you prefer not to use Homebrew, we provide automatic installers for both macOS and Linux:

macOS:

# Download and run the macOS installer
curl -fsSL https://raw.githubusercontent.com/wiiiimm/ra2mp3/main/install_macos.sh | bash

This script will:

  • Install Homebrew (if not already installed)
  • Install FFmpeg via Homebrew
  • Verify everything is working

Linux:

# Download and run the Linux installer
curl -fsSL https://raw.githubusercontent.com/wiiiimm/ra2mp3/main/install_linux.sh | bash

This script will:

  • Detect your Linux distribution (Ubuntu, Fedora, CentOS, Arch, etc.)
  • Install FFmpeg using the appropriate package manager
  • Verify everything is working

Manual Installation

macOS (Homebrew):

# Install Homebrew first if you don't have it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Then install FFmpeg:
brew install ffmpeg

Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg

CentOS/RHEL:

sudo yum install epel-release
sudo yum install ffmpeg

Usage

Quick Start (If installed via Homebrew)

# Go to your directory with .ra files
cd /path/to/your/ra/files

# Simply run ra2mp3 (it's already in your PATH!)
ra2mp3

# Or convert files from a specific directory
ra2mp3 --input /path/to/music --output /path/to/mp3s

Quick Start (Without Homebrew)

macOS:

# Go to your directory with .ra files
cd /path/to/your/ra/files

# Download and run the installer
curl -fsSL https://raw.githubusercontent.com/wiiiimm/ra2mp3/main/install_macos.sh | bash

# Download the converter script
curl -O https://raw.githubusercontent.com/wiiiimm/ra2mp3/main/ra2mp3
chmod +x ra2mp3

# Convert your files
./ra2mp3

Linux:

# Go to your directory with .ra files
cd /path/to/your/ra/files

# Download and run the installer
curl -fsSL https://raw.githubusercontent.com/wiiiimm/ra2mp3/main/install_linux.sh | bash

# Download the converter script
curl -O https://raw.githubusercontent.com/wiiiimm/ra2mp3/main/ra2mp3
chmod +x ra2mp3

# Convert your files
./ra2mp3

Manual Setup

# Go to your directory with .ra files
cd /path/to/your/ra/files

# Download the script
curl -O https://raw.githubusercontent.com/wiiiimm/ra2mp3/main/ra2mp3
chmod +x ra2mp3

# Make sure ffmpeg is installed (see Prerequisites above)
# Then run the conversion
./ra2mp3

The converted MP3 files will be saved in a ./converted/ directory, maintaining the original folder structure.

Supported input extensions: .ra, .ram, .rm (case-insensitive).

Advanced Usage

The script supports several command-line options for more control:

./ra2mp3 [OPTIONS]

Options:
  -i, --input DIR      Input directory to recursively search for .ra files (default: current directory)
  -o, --output DIR     Output directory for converted files (default: converted/)
  --overwrite          Overwrite existing MP3 files (forces overwrite)
  --strip-metadata     Strip metadata for smaller file sizes (default: preserve metadata)
  --dry-run            Show what would be converted without actually converting
  -v, --version        Show version information
  -h, --help           Show this help message

Examples

# Convert files from a specific directory
./ra2mp3 --input /path/to/music

# Save converted files to a specific location
./ra2mp3 --output /tmp/mp3s

# Overwrite existing MP3 files
./ra2mp3 --overwrite

# Strip metadata for smaller file sizes
./ra2mp3 --strip-metadata

# Preview what would be converted (dry run)
./ra2mp3 --dry-run

# Combine options
./ra2mp3 --input /old/music --output /new/mp3s --overwrite --dry-run

Example

your-music-folder/
β”œβ”€β”€ album1/
β”‚   β”œβ”€β”€ track1.ra
β”‚   └── track2.ra
β”œβ”€β”€ album2/
β”‚   └── track3.ra
└── ra2mp3

# After running the script:

your-music-folder/
β”œβ”€β”€ album1/
β”‚   β”œβ”€β”€ track1.ra
β”‚   └── track2.ra
β”œβ”€β”€ album2/
β”‚   └── track3.ra
β”œβ”€β”€ converted/
β”‚   β”œβ”€β”€ album1/
β”‚   β”‚   β”œβ”€β”€ track1.mp3
β”‚   β”‚   └── track2.mp3
β”‚   └── album2/
β”‚       └── track3.mp3
└── ra2mp3

Output Quality

The script uses FFmpeg's libmp3lame encoder with VBR quality setting 2, which provides excellent quality while keeping file sizes reasonable. This typically results in bitrates around 170-210 kbps.

Error Handling

  • Skips files that don't exist on disk
  • Skips files that have already been converted
  • Continues processing even if individual files fail to convert
  • Uses set -euo pipefail for robust error handling

License

MIT License - feel free to use, modify, and distribute as needed.

Development

This project uses Conventional Commits and semantic-release for automated versioning and releases.

Semantic Release

  • Automatic version bumping based on commit messages
  • Automated CHANGELOG.md generation
  • GitHub releases with release notes
  • Follows semantic versioning (MAJOR.MINOR.PATCH)

Pull Request Guidelines

  • PR titles are automatically formatted to conventional commit format
  • Use conventional commit types: feat:, fix:, docs:, chore:, etc.
  • Breaking changes should include ! or BREAKING CHANGE: in commit message
  • All PRs are automatically formatted to conventional commit format

Contributing

Issues and pull requests welcome! This project includes automated workflows for:

  • PR title formatting and validation
  • Automated releases and changelog generation
  • Code quality checks

When contributing:

  • Use conventional commit messages (feat:, fix:, docs:, etc.)
  • PR titles are automatically formatted
  • Releases are automated based on commit types
  • See CHANGELOG.md for release history

About RealAudio

RealAudio was a proprietary audio format developed by RealNetworks, popular in the late 1990s and early 2000s for streaming audio over dial-up connections. While largely obsolete today, you might encounter .ra files in old archives or legacy systems.

About

Convert RealAudio (.ra) files to MP3 format - bash script with installers for macOS and Linux

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages