Multichannel Playback Bridge β User Guide
Praat cannot reliably play more than two channels. This script exports the selected Sound to a temporary WAV and delegates playback to Python (sounddevice / ASIO / WASAPI). Supports any channel count (2, 4, 8, 16 β¦). Requires a professional audio interface for more than 2 channels on Windows.
What this does
This script implements a Multichannel Audio Playback Bridge β a solution for playing back multichannel audio (2, 4, 8, 16+ channels) from Praat, which natively cannot reliably play more than two channels. The script exports the selected Sound to a temporary WAV file and delegates playback to Python using the sounddevice library, which supports ASIO, WASAPI, and CoreAudio for low-latency multichannel output.
π§ Why is Multichannel Playback Needed?
Praat is designed primarily for speech analysis and can only play stereo audio reliably. However, many electroacoustic compositions, spatial audio works, and multichannel installations use 4, 6, 8, or more channels. This script bridges that gap by:
- Exporting the selected Sound to a temporary WAV file
- Calling a Python script that uses sounddevice for low-latency playback
- Supporting ASIO drivers on Windows for professional audio interfaces
- Automatically cleaning up temporary files after playback
Key Features:
- Any Channel Count β Supports 2, 4, 8, 16, or any number of channels
- ASIO/WASAPI/CoreAudio β Professional low-latency drivers on Windows, CoreAudio on macOS
- Device Selection β Choose specific output device by ID, or use system default
- Latency Options β Low (ASIO-optimised) or high (more stable)
- Downmix to Stereo β Automatic fold-down when device has fewer channels
- Device Listing β List all available output devices with channel counts
- Automatic Cleanup β Temp files deleted after playback
- Debug Mode β Detailed information about device and playback
Technical Implementation: (1) Export: Selected Sound saved as temporary WAV. (2) Python Detection: Find Python with sounddevice, soundfile, numpy. (3) Device Query: Optional device listing. (4) Playback: sounddevice.play() with specified device and latency. (5) Channel Handling: If audio channels > device channels, error unless downmix enabled. (6) Downmix: Equal-power fold-down to available channels. (7) Cleanup: Delete temp files, return status.
Quick start
- In Praat, select exactly one Sound object with any number of channels.
- Run scriptβ¦ β select
PlayMultichannel.praat. - Set Device_ID (-1 = system default). Use List_devices_and_exit first to find device IDs.
- Choose latency setting (low for ASIO, high for more stability).
- Enable Downmix_to_stereo_if_needed if you want automatic downmixing.
- Optionally enable List_devices_and_exit to see available devices.
- Click OK β script exports WAV, calls Python, plays audio, cleans up.
Multichannel Playback Theory
Channel Mapping
Latency Modes
β‘ Low Latency (ASIO-optimised)
Uses the smallest possible buffer size that the device supports. Suitable for real-time monitoring, interactive applications, and professional audio work. May cause dropouts on underpowered systems.
π‘οΈ High Latency (More Stable)
Uses larger buffer sizes, reducing CPU load and preventing dropouts. Suitable for playback-only applications, longer files, or systems with high DPC latency.
ASIO on Windows
Device Query
π Understanding Device Listing
The device list shows:
- ID: Numeric device identifier to use in Device_ID field
- Device Name: Manufacturer and model name
- Host API: Driver type (MME, WASAPI, ASIO, CoreAudio)
- Out Ch: Maximum output channels supported
On Windows: Look for devices with "ASIO" in the Host API column for low-latency multichannel playback. WASAPI devices may also support multichannel but with higher latency.
On macOS: CoreAudio devices typically support up to the interface's channel count.
Parameters & Controls
Device Parameters
| Parameter | Default | Description |
|---|---|---|
| Device_ID | -1 | Output device ID (-1 = system default). Use List_devices_and_exit to find IDs. |
Latency
| Parameter | Default | Description |
|---|---|---|
| Latency | low | low (ASIO-optimised) or high (more stable) |
Utilities
| Parameter | Default | Description |
|---|---|---|
| Downmix_to_stereo_if_needed | 0 | Automatically fold down to stereo when device has fewer channels |
| List_devices_and_exit | 0 | List all available output devices and exit |
| Print_debug_info | 0 | Print detailed device and playback information |
Device Management
Finding Your Device
- Set List_devices_and_exit = 1 in the form
- Click OK β the script will list all available output devices
- The Info window will show a table like:
ID Device Name Host API Out Ch 0 Speakers (Realtek High Definition Audio) MME 2 1 ASIO Fireface USB ASIO 12 2 Focusrite USB ASIO ASIO 8
Note the ID of the device you want to use (e.g., "1" for ASIO Fireface).
Device Selection Tips
π― Choosing the Right Device
- Stereo playback (2 channels): Any device with Out Ch β₯ 2 works. Default device (-1) is usually fine.
- Quadraphonic (4 channels): Need device with β₯ 4 outputs. Look for ASIO or multichannel WASAPI devices.
- 5.1 / 7.1 surround (6-8 channels): Many consumer sound cards support 6-8 channels via WASAPI. Professional interfaces via ASIO.
- Octophonic / higher (8+ channels): Requires ASIO on Windows, CoreAudio on macOS with appropriate interface.
ASIO Configuration
βοΈ Setting Up ASIO on Windows
- Install the ASIO driver for your audio interface (from manufacturer's website)
- Restart your computer
- Run List_devices_and_exit to confirm ASIO device appears with correct channel count
- In your ASIO control panel, ensure sample rate matches your audio file (usually 44.1 or 48 kHz)
- Configure the ASIO buffer size β lower = lower latency, higher = more stable
- Use the ASIO device ID in the script with latency="low"
Note: ASIO devices often require exclusive access β other applications may not be able to play sound simultaneously.
Downmix Mode
Applications
Electroacoustic Composition Playback
Use case: Playing back multichannel electroacoustic works
Technique: Use device ID of your multichannel interface, disable downmix
Workflow:
- Compose a multichannel piece using tools like Spectral Panning Mapper, Latent Spat, or Multitrack Router
- Export the result as a multichannel Sound in Praat
- Run this script with your ASIO device ID to audition the work
- The script ensures accurate channel mapping and low latency
Installation Art
Use case: Playing multichannel audio in gallery installations
Technique: Use high latency mode for stability, downmix if needed
Applications:
- Multi-speaker installations: Direct playback to 8+ speakers
- Ambisonic decoding: Play back ambisonic B-format audio
- Sound art: Automated playback cycles via scripting
Research & Education
Use case: Demonstrating multichannel spatialization techniques
Technique: Use List_devices_and_exit to show available hardware, discuss channel counts
Learning outcomes:
- Understand relationship between channel count and speaker layout
- Learn about ASIO, WASAPI, CoreAudio driver architectures
- Experience multichannel audio in classroom setting
Quality Assurance
Use case: Testing multichannel output of audio interfaces
Technique: Create test signals (e.g., pink noise on each channel) and verify routing
Example:
- Create a 4-channel Sound with tones on each channel
- Play back using this script on your quadraphonic system
- Verify each speaker plays the correct channel
Practical Workflow Examples
π¬ Film Sound: 5.1 Playback
Goal: Play back 5.1 surround mix from Praat
Settings:
- Sound: 6-channel 5.1 mix (L, R, C, LFE, Ls, Rs)
- Device: ASIO device with 6+ outputs
- Latency: low (for real-time monitoring)
- Downmix: 0 (preserve channel mapping)
Result: Accurate 5.1 playback through your monitoring system
ποΈ Laptop Demonstration
Goal: Demonstrate 8-channel work on laptop with only stereo speakers
Settings:
- Sound: 8-channel composition
- Device: -1 (default stereo device)
- Downmix: 1 (automatic fold-down)
- Latency: high (more stable on laptop)
Result: 8-channel work folded down to stereo for portable demonstration
π§ Device Testing
Goal: Test new multichannel interface
Settings:
- First run: List_devices_and_exit to confirm device appears
- Create test tones: 1kHz sine on each channel sequentially
- Play with device ID, verify routing
- Test latency settings to find optimal buffer size
Result: Verified device functionality and optimal settings
Troubleshooting Common Issues
Cause: Python not installed, or packages missing
Solution: Install Python and required packages: pip install sounddevice soundfile numpy
Cause: Selected device has fewer outputs than audio channels
Solution: Enable Downmix_to_stereo_if_needed, or choose a device with more channels
Cause: Device ID incorrect, or driver not installed
Solution: Run List_devices_and_exit to verify IDs; install appropriate drivers
Cause: Buffer too small for system load
Solution: Switch to "high" latency mode, or adjust buffer size in ASIO control panel
Cause: Device channel mapping may differ from WAV channel order
Solution: Verify with test signals; if persistent, note device's channel order
Advanced Techniques
For non-standard channel layouts, modify the downmix algorithm in the Python script to implement specific routing (e.g., LCRS, Ambisonic decoding).
Use Praat's scripting to iterate through multiple multichannel files, playing each with this script.
Most ASIO control panels allow buffer size adjustment. Smaller = lower latency, larger = more stable. Find the sweet spot for your system.
Some ASIO drivers support multi-client mode, allowing other applications to share the device. Enable in ASIO control panel if needed.