hi friends and seniors i want to play (add audio files, remove audio files,and other oprations) players(like vlc) through c++ coding in Ubuntu
help me out. how do i do this. i don't even have idea...
i know how to accept input from command prompt

6 Years
Discussion Span
Last Post by ravenous

Well I'm not sure what exactly you want to do. To launch vlc, you just type vlc in the terminal. If you want to add a file (audio or video), you just put it as command-line argument to vlc. And, you can use "system" to write a command to the terminal. So here is a simple example:

#include <iostream>
#include <string>
using namespace std;

int main() {
  cout << "Welcome to VLC launcher program!" << endl;
  cout << "Please enter a filename: ";
  string filename;
  getline(cin, filename);
  string comm = "vlc \"";
  comm += filename + "\"";
  system(comm.c_str()); //call VLC with the file "filename"
  return 0;

thanks mike
mike i have another ques in my mind. suppose i want to create my own music player then what are the things that i have to learn?
and how i can achieve it..


Check Libvlc. They have even examples there

There's also libav, which is what ffmpeg uses. I think that ffmpeg might also be used by vlc. Beware though, it's not for the feint-hearted! ffmpeg is directed at processing video files, but as part of this it can encode and decode many audio formats too.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.