Skip to main content

MOH Generator: Professional Music-On-Hold Track Creator

Open-source Python tool for creating professional Music-On-Hold (MOH) tracks by mixing music with periodic announcement messages. Features both an intuitive Streamlit web interface and powerful CLI with support for multiple audio formats, advanced audio processing, and configuration management.

Try It Now
MOH Generator: Professional Music-On-Hold Track Creator

MOH Generator: Professional Music-On-Hold Track Creation Made Simple

Creating professional Music-On-Hold (MOH) tracks for phone systems has traditionally required expensive audio editing software, technical expertise, and significant time investment. Call centers, small businesses, and telecom professionals often struggle to produce high-quality hold music that seamlessly integrates periodic announcements—resulting in amateur-sounding experiences that reflect poorly on their brand.

I developed MOH Generator as a completely free, open-source solution that automates the entire process of creating professional MOH tracks. Licensed under MIT, this Python-based tool provides both an intuitive drag-and-drop web interface for non-technical users and a powerful command-line interface for automation and integration, making professional phone system audio accessible to everyone.

With comprehensive audio processing capabilities including crossfading, normalization, and multi-format support, MOH Generator delivers broadcast-quality results without the broadcast-level price tag.

Key Features

Dual Interface Design

  • Streamlit Web UI: Professional drag-and-drop interface requiring zero technical knowledge—simply upload music and message files, adjust settings with intuitive sliders, and download your finished track
MOH Generator Web Interface showing drag-and-drop upload, audio processing settings, waveform visualization, and preview generation

Professional web interface with drag-and-drop file upload, real-time waveform visualization, and comprehensive audio processing controls

  • Command-Line Interface: Powerful CLI for automation, scripting, and integration with existing telephony workflows
  • Configuration Presets: Save and load your preferred settings for consistent production across multiple projects
  • Real-Time Preview: Generate 30-second previews to test your settings before creating full-length tracks
  • Python API: Use programmatically in your own applications for custom integrations

Advanced Audio Processing

  • Crossfading: Smooth transitions between music tracks with configurable crossfade duration (eliminates jarring cuts)
  • Fade In/Out Effects: Professional-sounding starts and endings with customizable fade durations
  • Audio Normalization: Automatic volume leveling ensures consistent audio levels throughout the entire track
  • Smart Volume Control: Independent volume adjustment for music and messages—automatically duck music during announcements
  • Message Timing: Precise control over announcement intervals and initial delay before the first message
  • Target Duration: Specify exact track length—automatically loops and trims music to match requirements

Comprehensive Format Support

  • Input Formats: WAV, MP3, OGG, FLAC, M4A, AAC—mix and match any combination
  • Output Formats: WAV (uncompressed), MP3 (compressed), OGG, FLAC (lossless)—optimized for different phone systems
  • Automatic Conversion: Seamlessly handles format differences without manual pre-processing
  • Quality Preservation: Maintains audio fidelity throughout processing chain

Professional Workflow Features

  • Batch Processing: Process multiple configurations in a single session using the Python API
  • Waveform Visualization: Interactive Plotly-powered waveform display for visual feedback
  • Recursive Directory Scanning: Automatically discover all audio files in nested folder structures
  • Comprehensive Logging: Detailed verbose output for troubleshooting and quality assurance
  • Configuration Export: Save settings to YAML files for version control and sharing

Who Benefits from MOH Generator?

Call Centers & Customer Service Departments

Enterprise and SMB Contact Centers: Create on-brand hold experiences with periodic updates about wait times, promotions, or service information. Update messages quickly without expensive audio production contracts. Perfect for seasonal campaigns and time-sensitive announcements.

VoIP Administrators & Telecom Professionals

System Integrators and PBX Managers: Integrate MOH production into automated provisioning workflows. Generate custom hold music for multi-tenant systems. Self-host for complete control over audio assets. Ideal for Asterisk, FreePBX, 3CX, and other VoIP platforms.

Small Businesses & Professional Services

Law Firms, Medical Offices, Consulting Firms: Project professionalism with custom hold music that includes your branding, office hours, and service highlights. No need for expensive audio production studios—create and update MOH tracks in minutes.

Marketing & Brand Teams

Marketing Professionals: Leverage the hold experience as a marketing touchpoint. Test different messaging strategies, promote new services, and reinforce brand identity during every customer interaction. Update campaigns as often as needed without additional costs.

Developers & System Integrators

Telephony Application Builders: Integrate MOH generation into customer portals, CRM systems, or telephony platforms. Fork the codebase for custom features, white-label the solution, or use as a foundation for SaaS offerings. MIT license permits commercial use.

IT Departments & MSPs

Managed Service Providers: Offer professional MOH creation as a value-added service to clients. Deploy on-premises or in the cloud. Eliminate recurring licensing fees while delivering professional results to multiple customers.

How It Works

Web Interface Workflow

The Streamlit-based web interface makes professional MOH creation accessible to anyone:

  1. Launch the Application: Run locally with streamlit run moh_generator/web/app.py or deploy to Streamlit Cloud for team access
  2. Upload Music Files: Drag and drop your background music tracks (WAV, MP3, OGG, FLAC, M4A, AAC)—upload multiple files for variety
  3. Upload Message Files: Add your announcement audio files—the system will insert them at specified intervals
  4. Configure Settings: Use intuitive sliders to adjust message intervals, volume levels, crossfade duration, and audio effects
  5. Preview Your Track: Generate a 30-second preview to verify settings before creating the full track
  6. View Waveform: See visual representation of your audio with interactive Plotly charts
  7. Generate Full Track: Create the complete MOH file in your preferred format
  8. Download Results: Save the finished track and deploy to your phone system
  9. Save Configuration: Export your settings as a YAML preset for future use

Command-Line Workflow

For developers and automation enthusiasts, the CLI provides powerful scripting capabilities:

# Basic usage with default settings
moh-generator -m music/ -msg messages/ -o output.wav

# Professional quality with advanced processing
moh-generator \
  -m music/ \
  -msg messages/ \
  -o professional.mp3 \
  --format mp3 \
  --crossfade 3000 \
  --fade-in 2000 \
  --fade-out 2000 \
  --normalize \
  --interval 30

# Create 5-minute track with precise timing
moh-generator \
  -m music/ \
  -msg messages/ \
  -o timed.wav \
  --duration 300 \
  --interval 20 \
  --delay 10

# Generate preview before full production
moh-generator \
  -m music/ \
  -msg messages/ \
  -o preview.mp3 \
  --preview 30

# Use configuration preset
moh-generator --config corporate_preset.yaml -o output.wav

# Save current settings for reuse
moh-generator \
  -m music/ \
  -msg messages/ \
  -o output.wav \
  --interval 20 \
  --normalize \
  --crossfade 2000 \
  --save-config my_preset.yaml

Python API Workflow

Integrate MOH generation directly into your Python applications:

from moh_generator import MOHGenerator

# Create generator instance
generator = MOHGenerator()

# Load audio files
generator.load_music(["song1.mp3", "song2.mp3", "song3.mp3"])
generator.load_messages(["welcome.wav", "promo.wav"])

# Configure processing settings
generator.configure(
    message_interval=20,
    initial_delay=10,
    music_volume_reduction=-8,
    message_volume_increase=12,
    crossfade_ms=2000,
    fade_in_ms=1000,
    fade_out_ms=1000,
    normalize=True,
    target_duration=300
)

# Generate the track
output_path = generator.generate("output.mp3", format="mp3")
print(f"Generated: {output_path}")

# Or create a preview first
preview = generator.get_preview(durati
preview.export("preview.mp3", format="mp3")

Technology Stack

Core Audio Processing

  • Python 3.9-3.12: Modern Python with type hints and comprehensive error handling
  • pydub: Industry-standard audio manipulation library built on ffmpeg
  • ffmpeg: Professional-grade audio/video processing engine powering the conversion pipeline

Web Interface

  • Streamlit: Rapid development of beautiful, responsive web applications with Python
  • Plotly: Interactive waveform visualization for real-time audio feedback
  • Custom UI Components: Polished user experience with intuitive controls and clear feedback

Configuration & Development

  • Poetry: Modern dependency management and packaging for reproducible builds
  • YAML: Human-readable configuration files for easy preset management
  • pytest: Comprehensive unit testing with full test coverage
  • black, isort, flake8, mypy: Code formatting, linting, and type checking for quality assurance

Deployment Options

  • Local Development: Run on any machine with Python 3.9-3.12 and ffmpeg
  • Self-Hosted: Deploy on internal servers for complete data control and customization
  • Streamlit Cloud: Free cloud hosting for the web interface with one-click deployment
  • Docker Containers: Containerized deployment for consistent environments (coming soon)
  • Cloud Platforms: Compatible with AWS, Google Cloud, Azure, and DigitalOcean
  • CI/CD Integration: Automated MOH generation in build pipelines

Real-World Use Cases

Corporate Call Center: Seasonal Campaign Updates

# Holiday promotion with 15-second message intervals
moh-generator \
  -m corporate_music/ \
  -msg holiday_promos/ \
  -o holiday_moh.mp3 \
  --interval 15 \
  --normalize \
  --crossfade 2000 \
  --format mp3

Use Case: Marketing team updates MOH tracks weekly during holiday season with new promotions, special hours, and shipping deadlines. Previously required outsourcing to audio production studio ($500-1000 per update). Now handled in-house in minutes.

Medical Office: Patient Information & Wait Times

# Professional medical office MOH with longer intervals
moh-generator \
  -m relaxing_music/ \
  -msg office_info/ \
  -o medical_moh.wav \
  --interval 30 \
  --delay 15 \
  --music-volume -10 \
  --message-volume 15 \
  --fade-in 2000 \
  --fade-out 2000 \
  --normalize

Use Case: Healthcare facility provides calming hold music with periodic messages about office hours, patient portal access, and appointment preparation. Updated monthly for flu shot campaigns and seasonal health tips.

MSP: Multi-Tenant VoIP System

#!/bin/bash
# Automated MOH generation for multiple clients
for client in clients/*/; do
  moh-generator \
    -m "$client/music/" \
    -msg "$client/messages/" \
    -o "productions/$(basename "$client")/moh.wav" \
    --config "$client/moh_config.yaml" \
    --normalize
done

Use Case: Managed service provider generates custom MOH tracks for 50+ clients, each with unique branding and messaging. Automated pipeline processes updates nightly, deploying to Asterisk PBX systems automatically.

E-commerce: Dynamic Promotional Messaging

# Create multiple versions for A/B testing
for version in promo_a promo_b promo_c; do
  moh-generator \
    -m upbeat_music/ \
    -msg "messages/$version/" \
    -o "test_tracks/$version.mp3" \
    --interval 20 \
    --duration 180 \
    --normalize \
    --format mp3
done

Use Case: Online retailer tests different promotional messages during peak shopping season. Analytics team tracks which MOH version correlates with higher post-call conversion rates. Quick iteration enables data-driven optimization.

Government Agency: Multilingual Public Service

# Generate MOH tracks in multiple languages
for lang in english spanish french mandarin; do
  moh-generator \
    -m neutral_music/ \
    -msg "messages/$lang/" \
    -o "moh_$lang.wav" \
    --interval 25 \
    --normalize \
    --crossfade 1500
done

Use Case: Municipal services department provides translated hold messages for diverse community. Each language version includes information about available services, office hours, and website resources.

Open Source Philosophy

Why Open Source Matters for Business Tools

Professional audio production tools shouldn't require enterprise budgets. MOH Generator embodies the principle that essential business tools should be transparent, accessible, and community-driven:

  • MIT License: Use freely for personal, commercial, or academic purposes with no restrictions—even white-label and resell if desired
  • Transparent Development: Every line of code is publicly visible on GitHub for security audits, learning, and trust
  • Community Contributions: Issues, pull requests, and feature suggestions welcome from all skill levels—your input shapes the roadmap
  • No Vendor Lock-In: Own your tools, modify them as needed, and never worry about subscription changes or forced upgrades
  • Educational Resource: Well-documented codebase with type hints and comprehensive comments serves as learning material for Python developers
  • Future-Proof: Even if original development stops, the community can maintain and extend indefinitely
  • Cost Savings: Zero licensing fees enable budget reallocation to other critical business needs
  • Customization Freedom: Modify the tool to fit your exact requirements without waiting for vendor feature requests

Contributing to the Project

MOH Generator thrives on community involvement. Whether you're a developer, audio professional, or business user, there are many ways to contribute:

  • Report bugs or request features through GitHub Issues
  • Submit pull requests with code improvements, new audio effects, or format support
  • Improve documentation and create tutorials or video walkthroughs
  • Share use cases and success stories to inspire others
  • Translate the interface for international users
  • Star the repository to show support and increase visibility
  • Help answer questions in Discussions and support other users

Business Impact & Benefits

Cost Savings

  • Eliminate Audio Production Costs: Save $500-2,000 per track by producing in-house
  • Zero Licensing Fees: No monthly/annual subscriptions for audio editing software
  • Unlimited Updates: Modify messaging as often as needed without additional costs
  • No Per-User Charges: Install on unlimited workstations for your team

Operational Efficiency

  • 95% Faster Production: Generate professional MOH tracks in minutes instead of hours
  • Self-Service Capability: Marketing and operations teams can update messaging without IT involvement
  • Automated Workflows: Integrate into existing CI/CD pipelines for zero-touch deployment
  • Consistent Quality: Configuration presets ensure brand-consistent audio across all touchpoints

Enhanced Customer Experience

  • Professional Brand Image: High-quality hold music reflects positively on your organization
  • Timely Information: Update callers about wait times, promotions, and important announcements
  • Reduced Perceived Wait Time: Engaging content makes holds feel shorter
  • Marketing Touchpoint: Convert idle hold time into promotional opportunities

Technical Advantages

  • Multi-Format Support: Works with any audio format and outputs to phone system requirements
  • Quality Preservation: Normalization and professional processing maintain audio fidelity
  • Scalability: From single-location businesses to multi-tenant service providers
  • Integration-Ready: Python API enables seamless integration with existing systems

Why Choose MOH Generator?

vs. Commercial Audio Software

Feature MOH Generator Adobe Audition Pro Tools
Cost Free (MIT License) $20.99/month $31.99/month
Learning Curve Minutes (Web UI) Weeks to Months Weeks to Months
MOH-Specific Features Built-In & Automated Manual Process Manual Process
Batch Processing Yes (CLI & API) Limited Limited
Automation/Scripting Full Python API JavaScript API Limited
Self-Hosting Yes No No
Deployment On-Premises or Cloud Desktop Only Desktop Only

vs. Audio Production Services

Aspect MOH Generator Professional Studio
Cost Per Track $0 $500-2,000
Turnaround Time Minutes 3-7 Days
Revisions Unlimited & Instant Limited (2-3 typically)
Control Complete Limited to Vendor
Update Frequency Unlimited Expensive Per Update

Getting Started

System Requirements

  • Python 3.9-3.12 (Python 3.13+ not yet supported due to pydub compatibility)
  • ffmpeg (free, open-source audio/video processing library)
  • 4GB RAM minimum (8GB recommended for large projects)
  • Any operating system (macOS, Linux, Windows)
  • Modern web browser for UI (Chrome, Firefox, Safari, Edge)

Quick Installation

# Clone the repository
git clone https://github.com/thepingdoctor/MOH_Generator.git
cd MOH_Generator

# Install ffmpeg (if not already installed)
# macOS:
brew install ffmpeg

# Ubuntu/Debian:
sudo apt-get install ffmpeg

# Windows: Download from ffmpeg.org

# Install with Poetry (recommended)
poetry install
poetry shell

# Launch web interface
streamlit run moh_generator/web/app.py

# Or use CLI directly
moh-generator --help

Alternative Installation with pip

# Clone the repository
git clone https://github.com/thepingdoctor/MOH_Generator.git
cd MOH_Generator

# Install dependencies
pip install -r requirements.txt

# Install the package
pip install -e .

# Run the web interface
streamlit run moh_generator/web/app.py

First MOH Track in 5 Minutes

  1. Create two folders: music/ and messages/
  2. Add your background music files to music/ (any format)
  3. Add your announcement audio to messages/
  4. Run: moh-generator -m music/ -msg messages/ -o my_first_moh.wav
  5. Upload my_first_moh.wav to your phone system

Performance & Optimization Tips

Processing Speed

  • Use WAV files for fastest processing—no decoding overhead, pure audio data
  • Normalize beforehand if all source files are at drastically different volumes
  • Preview first with --preview 30 to test settings before generating long tracks
  • Crossfade carefully on long playlists—while beautiful, crossfading is computationally expensive

Audio Quality

  • Source Quality Matters: Start with high-quality music (320kbps MP3 or lossless FLAC)
  • Match Phone System Format: Most VoIP systems prefer 8kHz or 16kHz mono WAV
  • Use Normalization: Always enable --normalize for consistent volume levels
  • Test Output: Play generated tracks through your actual phone system to verify quality

Workflow Efficiency

  • Configuration Presets: Save common settings with --save-config for instant reuse
  • Batch Processing: Use Python API to generate multiple variations simultaneously
  • Directory Organization: Keep music and messages in clearly labeled folders by campaign or purpose
  • Version Control: Track configuration YAML files in git alongside message scripts

Comprehensive Documentation

MOH Generator includes extensive documentation to help you get started and master advanced features:

  • README.md: Complete guide with installation, usage examples, and feature overview
  • QUICKSTART.md: Get your first MOH track created in 5 minutes
  • CONTRIBUTING.md: Developer guide for contributing code, reporting issues, and suggesting features
  • CHANGELOG.md: Detailed version history with all features, fixes, and breaking changes
  • PROJECT_SUMMARY.md: Comprehensive project overview and architectural decisions
  • Code Documentation: Thoroughly documented source code with type hints and docstrings
  • Example Configurations: Pre-built YAML presets for common use cases

Community Feedback

"We were paying $800 per MOH update to our audio production vendor. MOH Generator paid for itself (free!) in the first week. Now our marketing team updates messaging weekly without involving IT or external vendors."

— IT Director, Regional Call Center

"The Python API was perfect for our use case. We integrated MOH generation into our multi-tenant VoIP portal—clients can now upload their own music and messages through a web interface. Massive value-add for minimal development effort."

— CTO, Cloud Communications Platform

"As a solo practitioner, I can't justify expensive audio software subscriptions. MOH Generator's web interface is so simple my office manager handles all our hold music updates. Professional results, zero cost."

— Small Business Owner, Professional Services

Start Creating Professional MOH Tracks Today

Join the growing community of businesses, developers, and telecom professionals leveraging open-source technology for professional music-on-hold production. Whether you're creating a single track for your small business or building automated workflows for enterprise call centers, MOH Generator provides the tools you need without the enterprise price tag.

Need Custom Development or Integration?

If you require custom features, enterprise telephony integration, white-label solutions, or consulting assistance for MOH Generator or similar audio automation projects, I'm available for development work. Let's discuss how I can help streamline your communications workflows.

Contact Me for Custom Solutions

Perfect For

MOH Generator is the ideal solution for anyone needing professional music-on-hold production:

  • Music-on-hold creation and telephony audio production
  • Call center and contact center operations
  • VoIP system administration (Asterisk, FreePBX, 3CX)
  • PBX configuration and telephony management
  • Small business phone systems
  • Corporate communications and customer service
  • Marketing message automation
  • Multi-tenant VoIP platforms
  • Managed service provider (MSP) offerings
  • Audio branding and corporate identity
  • Telecom application development
  • Cloud communications platforms
  • Customer experience optimization
  • Professional services firms
  • Healthcare and medical office communications