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.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 1.0 (2025) License: MIT License Citation: Cohen, S. (2025). Praat AudioTools Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

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:

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

  1. In Praat, select exactly one Sound object with any number of channels.
  2. Run script… β†’ select PlayMultichannel.praat.
  3. Set Device_ID (-1 = system default). Use List_devices_and_exit first to find device IDs.
  4. Choose latency setting (low for ASIO, high for more stability).
  5. Enable Downmix_to_stereo_if_needed if you want automatic downmixing.
  6. Optionally enable List_devices_and_exit to see available devices.
  7. Click OK β€” script exports WAV, calls Python, plays audio, cleans up.
Quick tip: First run with List_devices_and_exit = 1 to see all available output devices and their channel counts. Note the device ID you want to use (e.g., "0", "1"). Then run again with that Device_ID and List_devices_and_exit = 0. On Windows, use ASIO drivers for multichannel audio interfaces to get low latency and full channel count.
Important: PYTHON DEPENDENCIES β€” Requires Python with sounddevice, soundfile, numpy installed. ASIO DRIVERS β€” On Windows, for more than 2 channels you need ASIO drivers and an ASIO-compatible audio interface. DEVICE IDs can change if you add/remove hardware β€” use List_devices_and_exit to verify before important sessions. DOWNNIX uses equal-power fold-down: channels are summed in pairs (ch0+ch2+... β†’ left, ch1+ch3+... β†’ right) and normalised to prevent clipping.

Multichannel Playback Theory

Channel Mapping

When audio has N channels and device supports M output channels: If N ≀ M: direct mapping (channel i β†’ device output i) If N > M: error unless downmix enabled Downmix algorithm (equal-power fold-down to stereo): n_out = min(2, M) left = Ξ£ audio[:, i] for i where i mod 2 = 0 right = Ξ£ audio[:, i] for i where i mod 2 = 1 gain = 1 / ceil(N / n_out) output = [left Γ— gain, right Γ— gain]

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

ASIO (Audio Stream Input/Output) is a professional audio driver protocol that: β€’ Bypasses the Windows audio mixer (WASAPI/MME) β€’ Provides low latency (2-10ms) β€’ Supports multiple channels (up to 32+) β€’ Allows direct hardware access To use ASIO in this script: 1. Install ASIO drivers for your audio interface 2. Select the ASIO device using its device ID (from --list-devices) 3. Use "low" latency mode for best performance

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

ParameterDefaultDescription
Device_ID-1Output device ID (-1 = system default). Use List_devices_and_exit to find IDs.

Latency

ParameterDefaultDescription
Latencylowlow (ASIO-optimised) or high (more stable)

Utilities

ParameterDefaultDescription
Downmix_to_stereo_if_needed0Automatically fold down to stereo when device has fewer channels
List_devices_and_exit0List all available output devices and exit
Print_debug_info0Print detailed device and playback information

Device Management

Finding Your Device

  1. Set List_devices_and_exit = 1 in the form
  2. Click OK β€” the script will list all available output devices
  3. 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

  1. Install the ASIO driver for your audio interface (from manufacturer's website)
  2. Restart your computer
  3. Run List_devices_and_exit to confirm ASIO device appears with correct channel count
  4. In your ASIO control panel, ensure sample rate matches your audio file (usually 44.1 or 48 kHz)
  5. Configure the ASIO buffer size β€” lower = lower latency, higher = more stable
  6. 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

When Downmix_to_stereo_if_needed = 1, the script will: 1. Check if audio channels > device channels 2. If true, perform equal-power fold-down to min(2, device_channels) 3. Apply normalisation to prevent clipping (peak ≀ 0.99) Example: 8-channel audio played on stereo device: left = (ch0 + ch2 + ch4 + ch6) / 4 right = (ch1 + ch3 + ch5 + ch7) / 4

Applications

Electroacoustic Composition Playback

Use case: Playing back multichannel electroacoustic works

Technique: Use device ID of your multichannel interface, disable downmix

Workflow:

Installation Art

Use case: Playing multichannel audio in gallery installations

Technique: Use high latency mode for stability, downmix if needed

Applications:

Research & Education

Use case: Demonstrating multichannel spatialization techniques

Technique: Use List_devices_and_exit to show available hardware, discuss channel counts

Learning outcomes:

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:

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

Problem: Python not found or missing packages
Cause: Python not installed, or packages missing
Solution: Install Python and required packages: pip install sounddevice soundfile numpy
Problem: "Audio has X channels but device supports only Y" error
Cause: Selected device has fewer outputs than audio channels
Solution: Enable Downmix_to_stereo_if_needed, or choose a device with more channels
Problem: No sound / device not found
Cause: Device ID incorrect, or driver not installed
Solution: Run List_devices_and_exit to verify IDs; install appropriate drivers
Problem: Dropouts/crackling during playback
Cause: Buffer too small for system load
Solution: Switch to "high" latency mode, or adjust buffer size in ASIO control panel
Problem: Channels swapped or incorrect
Cause: Device channel mapping may differ from WAV channel order
Solution: Verify with test signals; if persistent, note device's channel order

Advanced Techniques

Custom channel mapping:

For non-standard channel layouts, modify the downmix algorithm in the Python script to implement specific routing (e.g., LCRS, Ambisonic decoding).

Batch playback:

Use Praat's scripting to iterate through multiple multichannel files, playing each with this script.

ASIO buffer tuning:

Most ASIO control panels allow buffer size adjustment. Smaller = lower latency, larger = more stable. Find the sweet spot for your system.

Multi-client ASIO:

Some ASIO drivers support multi-client mode, allowing other applications to share the device. Enable in ASIO control panel if needed.