Page 1 of 1

Number of channels of current audio track

Posted: 28 Jul 2015 14:23
by ppcat
I have some application:

Code: Select all

const char *params[] = { "--ignore-config", }; vlcInstance = libvlc_new(sizeof(params) / sizeof(params[0]), params); player = libvlc_media_player_new(vlcInstance); libvlc_media_t* media = libvlc_media_new_path(vlcInstance, (const char*)ccName); libvlc_media_player_set_media(player, media); // and so on...
How can i get number of channels of the current audiotrack (mono, stereo, quadro, ...)?

Re: Number of channels of current audio track

Posted: 28 Jul 2015 19:53
by sherington
Start here:

https://www.videolan.org/developers/vlc ... 07e0e80f02

Use libvlc_media_tracks_get. You then iterate the returned structure to get a libvlc_media_track_t:

https://www.videolan.org/developers/vlc ... ck__t.html

And finally when you find an audio track:

https://www.videolan.org/developers/vlc ... ck__t.html

This structure has the number of channels.

Re: Number of channels of current audio track

Posted: 29 Jul 2015 13:34
by ppcat
Thanks, it helped me.