[ecasound] How to find out if an mp3/ogg file is mono or stereo?

From: Matthias Geier <matthias.geier@email-addr-hidden>
Date: Wed May 29 2013 - 12:17:59 EEST

Dear list.

I'm using the Ecasound interactive mode via the C++ interface
(eca-control-interface.h) in an application to play audio files via
Therefore, I first load the files into a dummy chain-setup to get the
number of channels and then create another chain-setup with the
correct number of channels (using cs-set-audio-format).

This works well for WAV and FLAC files, but I cannot manage to get the
correct number of channels for mono MP3 and OGG files.

This is how to reproduce my problem:

ecasound -c

> ai-add house_lo.mp3
> ao-add null
> cs-connect
> ai-index-select 1
> ai-get-format

This produces "s16_le,2,11025", although the file is actually mono.

I got the file from there:

I tried with several different MP3-files and none of them was
correctly recognized as mono file.

It doesn't seem to work with OGG-files either, I tried this for example:

How can I find out the correct number of channels?

Or is there another way to create a chain-setup for playback with JACK
which automatically uses the correct number of channels (instead of
the default 2)?


Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
Ecasound-list mailing list
Received on Wed May 29 12:15:03 2013

This archive was generated by hypermail 2.1.8 : Wed May 29 2013 - 12:15:04 EEST