Page 1 of 1

Identify the left and right channels

Posted: Thu Feb 03, 2011 12:22 pm
by JawadRehman
I am working on OOS to implement mp3 player. How it is possible to identify the left and right channels from the data read from the sound card . Presently i am operating the sound card in stero mode.

Re: Identify the left and right channels

Posted: Thu Feb 03, 2011 12:46 pm
by igorzwx
JawadRehman wrote:I am working on OOS to implement mp3 player. How it is possible to identify the left and right channels from the data read from the sound card . Presently i am operating the sound card in stero mode.


OSS is already implemented in the Russian Ultimate Music Player For GNU/Linux
http://deadbeef.sourceforge.net/

It is "open source". Perhaps, you may borrow some code.

Notice that the player is "ultimate". It seems to mean that it is impossible to make anything better. Although, it might be possible to improve the OSS plugin.

Re: Identify the left and right channels

Posted: Thu Feb 03, 2011 5:43 pm
by cesium
IIRC, OSS input data is interleaved, so every even index (starting from zero, of course) input is left channel and every odd index input is right channel.