Thread: mp3 player

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    4

    Question mp3 player

    i want to make a basic mp3 player, just command line at first and then once i have it working nicley ill make it gui. i do have a decent amount of programing knowledge in c++ opengl and vc++ enough to make my own simple 3d game which was more of a techdemo. but ive never done anyhing with sound and id like to venture off into that. but one of the things i have with stuff like this is that if i make an mp3 player i want to be able to do it the right way, the way a developer for a commercial company would, even though it obviously wouldnt be to the same scale. i just dont want to use come class that some guy made that makes my whole program into 3 lines. ive google searched and checked msdn and everything and the only thing i can come up with is directsound which would work i guess but im not really looking to make it for a game, just a standalone compact mp3 player that i could eventually expand into a nice player and maybe put in some opengl affects for displaying album art and stuff, but right now my concern is just to find out how id get the music working.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    So how are you actually going to play sound? Are you going to use DirectSound or some other interface?

    You could have a look at SDL_mixer, which uses the SDL to play sound. I think SDL_mixer uses SMPEG behind the scenes. I highly recommend the SDL. It's cross-platform, so you'd be able to run your program under many different operating systems. And on Windows it uses DirectX, so you don't lose any performance.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    4
    well thats what im asking, how should i play my sound? i dont want to use directx or sdl cause im not making a game. im making an mp3 player and i know no one would ever be able to tell the difference but i want to know how i could actually do it. i feel like using directx for an mp3 player even though it would work would be like using the wrong tool.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by cmyoung23 View Post
    well thats what im asking, how should i play my sound? i dont want to use directx or sdl cause im not making a game. im making an mp3 player and i know no one would ever be able to tell the difference but i want to know how i could actually do it. i feel like using directx for an mp3 player even though it would work would be like using the wrong tool.
    DirectSound is exactly for playing sound. DirectX is for doing things "directly", not just for games.

    SDL would be a bit more generic, so if you want to port your MP3 player to for example Linux, you'd have a better starting point.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Sep 2007
    Posts
    4
    i think you guys are missing my point. im basically asking how programs like windows media player , quicktime, and vlc play their sound. and were could i go to read up on it. i really dought wmp uses directsound

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by cmyoung23 View Post
    i think you guys are missing my point. im basically asking how programs like windows media player , quicktime, and vlc play their sound. and were could i go to read up on it. i really dought wmp uses directsound
    I'm 99% sure that media player uses DirectX - I don't see why it doesn't. QuickTime likewise.

    [Both of them use DirectX to draw to the screen when showing Video].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    vlc is open source - maybe go read that?
    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.

  8. #8
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129

  9. #9
    Registered User
    Join Date
    Sep 2007
    Posts
    4
    i looked it up and wmp (not including the vista version) actually does use directsound. i was under the impression that direct sound was really just for sound in games. now that i know it would be proper to use it, i have everything i wanted to know and can start reading up on it. thanks

    and actually reading vlcs source was a good idea too, i didnt think of that and i probably will

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 11-03-2008, 09:48 PM
  2. Speaker suggestions for MP3 player
    By ulillillia in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 05-08-2007, 03:06 AM
  3. which Portable mp3 player?
    By Raihana in forum A Brief History of Cprogramming.com
    Replies: 27
    Last Post: 01-09-2004, 07:58 AM
  4. mp3 players vs mp3 cd players
    By Geo-Fry in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-06-2003, 09:22 PM