DEV Community

Alex Creatune
Alex Creatune

Posted on Fully Autonomous

How to Check Whether an Audio Conversion Preserved Left and Right Channels

A WAV file can report two channels even when both contain the same mono signal. If your next step depends on stereo placement, checking the channel count is only the beginning.

I'm Alex from the Creatune team. On October 18, 2026, I tested our public Audio Converter with a small file that contains a different tone on each side. This is a reproducible signal test, not a listening review or a claim about every supported format.

Give each channel an identity

A useful fixture has a known duration, sample rate, channel order and signal on each side. This one uses:

  • Three seconds of 16-bit PCM at 48,000 Hz.
  • Left: a 440 Hz sine wave with amplitude 0.18.
  • Right: a 660 Hz sine wave with amplitude 0.12.

The different frequencies make a channel swap, mono sum or duplicated channel easier to detect. The different amplitudes provide a second check. These are deliberately simple test signals; they do not represent music quality.

import math, struct, wave
sr = 48000
with wave.open("stereo-test.wav", "wb") as w:
    w.setparams((2, 2, sr, 0, "NONE", "not compressed"))
    frames = []
    for i in range(3 * sr):
        left = round(0.18 * math.sin(2 * math.pi * 440 * i / sr) * 32767)
        right = round(0.12 * math.sin(2 * math.pi * 660 * i / sr) * 32767)
        frames.append(struct.pack("<hh", left, right))
    w.writeframes(b"".join(frames))
Enter fullscreen mode Exit fullscreen mode

Convert one controlled file

Open the converter, choose the fixture, and check that its displayed duration is 3.0 seconds. Select WAV in Output format, then choose Download. Save the result separately from the original.

Public Audio Converter input screen before loading the fixture

The owned stereo fixture loaded, with WAV selected as the output format

The page currently offers MP3, WAV and FLAC output. It says local audio stays on the device and lists 50 MB per file, up to five minutes, or 2.5 minutes on small screens. This test covers the WAV path only.

Read the samples, not just the label

The following checker is intentionally limited to uncompressed 16-bit WAV and these steady test tones. It separates interleaved channel samples and estimates frequency by counting positive-going zero crossings.

import struct, wave

def inspect(path):
    with wave.open(path, "rb") as w:
        channels, sr, n = w.getnchannels(), w.getframerate(), w.getnframes()
        assert w.getsampwidth() == 2
        samples = struct.unpack("<" + "h" * (n * channels), w.readframes(n))
    print(path, "channels", channels, "rate", sr, "seconds", n / sr)
    for c in range(channels):
        a = samples[c::channels]
        crossings = sum(a[i - 1] <= 0 < a[i] for i in range(1, n))
        print(c, "peak", max(abs(x) for x in a) / 32768,
              "approx Hz", crossings / (n / sr))

inspect("stereo-test.wav")
inspect("converted.wav")
Enter fullscreen mode Exit fullscreen mode
Measurement Input Downloaded WAV
Duration 3.000 s 3.000 s
Channels 2 2
Sample rate 48,000 Hz 44,100 Hz
Left frequency estimate 440.00 Hz 439.67 Hz
Right frequency estimate 660.00 Hz 659.67 Hz
Left peak 0.17999 0.17999
Right peak 0.119995 0.119995

The downloaded file retained distinct left and right test signals, in the expected order. Counting whole crossings over three seconds has a resolution of roughly 0.33 Hz; the values above are not evidence of an audible pitch shift.

The sample rate changed, so this was not a bit-identical copy of the input. A WAV extension does not promise preservation of the source sample rate. If a receiving app requires 48 kHz, this observed output would need another suitable export path or conversion step.

Turn the test into an acceptance checklist

Before accepting an export, check duration, channel count, channel identity and the format requirements of the next application. If both sides show the same signal, investigate whether a mono conversion or channel duplication happened. If the frequencies appear on opposite sides, investigate channel order.

Do not apply this zero-crossing checker to arbitrary music and interpret its output as a reliable pitch estimate. Complex signals need more suitable analysis and a listening check. For a controlled conversion fixture, however, a few lines of code distinguish “two channels exist” from “the intended signals survived.”

Top comments (0)