how do i write a c program to create a command line based music player

This is a discussion on how do i write a c program to create a command line based music player within the C Programming forums, part of the General Programming Boards category; how do i Create a command line based music player, which will list out the songs available, allow the user ...

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    2

    how do i write a c program to create a command line based music player

    how do i Create a command line based music player, which will list out the songs available, allow the user to create a play list. Play the song, skip track, and shuffle the tracks.
    The play list size should be dynamic


    can any one help me out???

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,650
    Err... you're basically presenting a vague sketch of the requirements of a program that might not be very trivial, and then asking for help. That's tough.

    What exactly do you need to help with?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by pradhan.mcis View Post
    how do i Create a command line based music player, which will list out the songs available, allow the user to create a play list. Play the song, skip track, and shuffle the tracks.
    The play list size should be dynamic


    can any one help me out???
    If you are on a Windows OS check out the command set in MCI. It's very easy to play music this way and it will play anything you have a standard codec for.

    As for the listings, playlists etc. Check out the M3U standard. It's very simple and interchanges with many of the more popular media players.

    The rest is just disk access and array sorting.

    Get yourself started, post your code if you run into troubles and lets see what happens...

  4. #4
    Registered User
    Join Date
    Nov 2010
    Posts
    2
    Quote Originally Posted by laserlight View Post
    Err... you're basically presenting a vague sketch of the requirements of a program that might not be very trivial, and then asking for help. That's tough.

    What exactly do you need to help with?
    i would know how to create a command line music player in ubuntu which is capable of playing and shuffling songs. i need a c code for this

  5. #5
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Oh really, would you like some champagne with your code as well?
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,499
    Some problems are like shooting fish in a barrel.
    mplayer - command line movie and music player - music over ssh | Linux Operating System

    If you want the source - go find it.

    Then read it to figure out the basics of reading a file, and opening an audio device.
    The rest is just detail.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do i write a program that does this?
    By rondel in forum C Programming
    Replies: 1
    Last Post: 10-24-2009, 09:56 AM
  2. Replies: 15
    Last Post: 10-20-2009, 09:39 AM
  3. how could i write this program: cat < apa | wc | wc > bepa
    By strugglingman in forum C Programming
    Replies: 2
    Last Post: 04-26-2006, 04:40 PM
  4. Hints to write a program
    By Bnchs400 in forum C++ Programming
    Replies: 28
    Last Post: 04-05-2006, 05:35 AM
  5. C program for creating player list
    By Swapnil in forum C Programming
    Replies: 11
    Last Post: 09-13-2003, 06:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21