Sign inSign up

cnsoluciones/wav2multi

By cnsoluciones

•Updated 11 months ago

šŸŽµ wav2multi - Multi-Format Audio Transcoder

Image
Networking
0

3.0K

cnsoluciones/wav2multi repository overview

ā šŸŽµ wav2multi - Multi-Format Audio Transcoder

Docker Image Docker Pulls Docker Image Size License

Professional multi-format audio transcoder for VoIP telephony codecs

Convert WAV audio files to G.729, μ-law, A-law, and SLIN formats with excellent compression and compatibility. Optimized for VoIP applications, IP telephony, and telecommunications systems.


ā šŸš€ Quick Start

# G.729 conversion (8 kbps - high compression)
docker run --rm -v $PWD:/work cnsoluciones/wav2multi:latest input.wav output.g729 --format g729

# μ-law conversion (64 kbps - US standard)
docker run --rm -v $PWD:/work cnsoluciones/wav2multi:latest input.wav output.ulaw --format ulaw

# A-law conversion (64 kbps - European standard)
docker run --rm -v $PWD:/work cnsoluciones/wav2multi:latest input.wav output.alaw --format alaw

# SLIN conversion (128 kbps - raw PCM)
docker run --rm -v $PWD:/work cnsoluciones/wav2multi:latest input.wav output.slin --format slin

ā šŸ“‹ Supported Formats

FormatBitrateUse CaseCompression
G.7298 kbpsVoIP, maximum compression94%
μ-law64 kbpsStandard telephony (US)50%
A-law64 kbpsEuropean telephony50%
SLIN128 kbpsRaw 16-bit PCM0%

⁠✨ Key Features

  • āœ… Multi-format support: G.729, μ-law, A-law, SLIN
  • āœ… High-quality codecs: Uses libbcg729 for G.729, native Go for others
  • āœ… Ultra-light image: Only ~19MB (Alpine Linux)
  • āœ… Multi-architecture: Supports amd64 and arm64
  • āœ… Easy to use: Simple command-line interface
  • āœ… Automatic validation: Checks WAV format requirements
  • āœ… Backward compatible: Legacy format still supported

ā šŸ“¦ Image Information

  • Base Image: Alpine Linux (multi-stage build)
  • Size: ~19MB compressed
  • Architectures: linux/amd64, linux/arm64
  • Go Version: 1.23
  • CGO: Enabled (for G.729 support)

ā šŸ”§ Requirements

Your WAV files must meet these specifications:

  • Format: PCM (AudioFormat = 1)
  • Channels: Mono (1 channel)
  • Sample Rate: 8000 Hz
  • Bits per Sample: 16-bit

ā šŸ’” Usage Examples

⁠Basic Conversion
# Convert to G.729 (highest compression)
docker run --rm -v $PWD:/work cnsoluciones/wav2multi:latest audio.wav audio.g729 --format g729

# Legacy format (auto-detect from extension)
docker run --rm -v $PWD:/work cnsoluciones/wav2multi:latest audio.wav audio.g729
⁠Batch Processing
# Convert all WAV files in current directory
for file in *.wav; do
    docker run --rm -v $PWD:/work cnsoluciones/wav2multi:latest "$file" "${file%.wav}.g729" --format g729
done
⁠With Custom Path
# Mount specific directory
docker run --rm -v /path/to/audio:/work cnsoluciones/wav2multi:latest input.wav output.g729 --format g729
⁠Get Help
# Show complete help
docker run --rm cnsoluciones/wav2multi:latest --help

# Show version
docker run --rm cnsoluciones/wav2multi:latest --version

ā āœ… Verify Conversions

Convert back to WAV using FFmpeg to verify quality:

# Verify G.729
ffmpeg -f g729 -i output.g729 -ar 8000 -ac 1 -c:a pcm_s16le verify.wav

# Verify μ-law
ffmpeg -f mulaw -i output.ulaw -ar 8000 -ac 1 -c:a pcm_s16le verify.wav

# Verify A-law
ffmpeg -f alaw -i output.alaw -ar 8000 -ac 1 -c:a pcm_s16le verify.wav

# Verify SLIN
ffmpeg -f s16le -ar 8000 -ac 1 -i output.slin -c:a pcm_s16le verify.wav

ā šŸ”„ Converting Incompatible Files

If your WAV file doesn't meet requirements, convert it with FFmpeg:

# All-in-one conversion to compatible format
ffmpeg -i input.mp3 -ar 8000 -ac 1 -sample_fmt s16 -acodec pcm_s16le output.wav

# Then transcode
docker run --rm -v $PWD:/work cnsoluciones/wav2multi:latest output.wav output.g729 --format g729

ā šŸ“Š Codec Technical Details

⁠G.729 (High Compression)
  • Bitrate: 8 kbps
  • Frame size: 10ms (80 samples @ 8kHz)
  • Usage: VoIP, IP telephony, videoconferencing
  • Implementation: libbcg729 library (CGO)
⁠μ-law (Standard Telephony)
  • Bitrate: 64 kbps
  • Usage: US telephony, legacy systems
  • Implementation: Native Go algorithm
⁠A-law (European Standard)
  • Bitrate: 64 kbps
  • Usage: European telephony, international
  • Implementation: Native Go algorithm
⁠SLIN (Raw PCM)
  • Bitrate: 128 kbps
  • Usage: Raw audio, debugging, high quality
  • Implementation: Direct PCM extraction

ā šŸ› Troubleshooting

⁠Error: "WAV is not PCM"
ffmpeg -i file.wav -acodec pcm_s16le output.wav
⁠Error: "mono required (1 channel)"
ffmpeg -i file.wav -ac 1 output.wav
⁠Error: "8000 Hz required"
ffmpeg -i file.wav -ar 8000 output.wav
⁠All-in-one fix
ffmpeg -i input.mp3 -ar 8000 -ac 1 -sample_fmt s16 -acodec pcm_s16le output.wav

ā šŸŽÆ Use Cases

  • VoIP Systems: Prepare audio files for Asterisk, FreeSWITCH
  • IP Telephony: Convert hold music, announcements, IVR prompts
  • Telecommunications: Standard format conversion for telecom systems
  • Audio Optimization: Reduce file sizes for bandwidth-constrained applications
  • Testing: Generate test files in different codec formats

ā šŸ—ļø Technical Architecture

This Docker image uses a multi-stage build for optimal size:

  1. Build Stage: Compiles bcg729 library and Go binary
  2. Runtime Stage: Only includes binary and essential libraries
  3. Result: Ultra-light ~19MB image
⁠What's Inside
  • Alpine Linux (minimal base)
  • Go 1.23 compiled binary
  • libbcg729.so (G.729 codec library)
  • Minimal dependencies (ca-certificates, libc6-compat)

ā šŸ“š Documentation

ā šŸ‘Øā€šŸ’» Author

Federico Pereira - [email protected]⁠

ā šŸ¢ CNSoluciones

This project is part of CNSoluciones, specialized in telecommunications and VoIP solutions.

ā šŸ“„ License

wav2multi is licensed under the Apache License 2.0.

Copyright Ā© 2025 Federico Pereira [email protected]⁠

⁠Quick Summary

āœ… You CAN: Use commercially, modify, distribute, sublicense
āš ļø You MUST: Include copyright, provide attribution, state changes
āŒ You CANNOT: Hold author liable, remove copyright notices

⁠Third-Party Components
  • bcg729 (GPLv3) - G.729 codec library
  • go-wav (MIT) - WAV file parsing
  • go-audio (Apache 2.0) - Audio processing
⁠Patent Information

G.729 codec patents expired in 2017. Free to use worldwide without royalties.

⁠Commercial Licensing

Need different terms? Commercial licenses available:

For complete terms, see LICENSE⁠

ā šŸ¤ Contributing

Contributions are welcome! Please visit our GitHub repository⁠ to:

  • Report issues
  • Submit pull requests
  • Request features
  • Improve documentation

⁠🌟 Show Your Support

If you find this project useful, please:

  • ⭐ Star the GitHub repository⁠
  • 🐳 Pull and use the Docker image
  • šŸ“¢ Share with your team
  • šŸ¤ Contribute improvements

Questions or issues? Open an issue on GitHub⁠

Made with ā¤ļø by CNSoluciones | Telecommunications & VoIP Solutions

Tag summary

Content type

Image

Digest

sha256:887947f29…

Size

5.4 MB

Last updated

11 months ago

docker pull cnsoluciones/wav2multi