C++ Help

Discussion in 'Mac Programming' started by polevault139, Nov 2, 2007.

  1. macrumors 6502

    Sep 24, 2006
    I am trying to play an mp3 in my code so I have a file called halo.mp3 on my desktop so how would I access it?

    I have system("halo.mp3");

    It's not working so how do I fix this?
    I am working in XCode, my friend wrote the program on a Windows machine and I have no experience writing in C++ so I just hope this will work. The program works except for that part.

    Thanks for your help.
  2. macrumors 68030


    Apr 17, 2004
    You need to put "open /path/to/halo.mp3"

    so if your halo.mp3 was in your music folder just under the music folder it would be
    system("open ~/Music/halo.mp3"); which then opens itunes and plays halo.mp3

Share This Page