Sorry I am new here and starting to code libvlc in C for Windows 10.
I succeeded playing a MP3/M4a using
Code: Select all
bool avlc_startPlayVLC(char* soundpath)
{
libvlc_media_t *m;
// create a new item
m = libvlc_media_new_path(avlc_inst, soundpath);
if (m == NULL) return false;
libvlc_media_parse(m);
// create a media play playing environment
avlc_mp = libvlc_media_player_new_from_media(m);
if (avlc_mp == NULL) return false;
// no need to keep the media now
libvlc_media_release(m);
// play the media_player
libvlc_media_player_play(avlc_mp);
return true;
}
Code: Select all
bool avlc_startStreamVLC(char* server)
{
libvlc_media_t *m;
// create a new item
m = libvlc_media_new_location(avlc_inst, server);
if (m == NULL) return false;
// create a media play playing environment
avlc_mp = libvlc_media_player_new_from_media(m);
if (avlc_mp == NULL) return false;
// no need to keep the media now
libvlc_media_release(m);
// play the media_player
libvlc_media_player_play(avlc_mp);
return true;
}
Could someone give me a simple piece of code to play the nth track of an audio CD via libvlc, please?
Thanks a lot
Cathy from France