PDA

View Full Version : C++ Help




polevault139
Nov 2, 2007, 06:35 PM
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.



slooksterPSV
Nov 3, 2007, 12:55 AM
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.

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