PDA

Visualizza la versione completa : [C++] Riprodurre mp3


kirakira93
22-03-2010, 15:37
Ciao ragazzi c' una funzione che riproduce mp3 in c++?
Ho provato questo ma non va.



#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <iostream>
#include <conio.h>

using namespace std;

int main(){

mciSendString("OPEN C:\\Users\\Niko\\Desktop\\Music\\bad romance.mp3 TYPE mpegvideo", NULL, 0, 0);

mciSendString("PLAY C:\\Users\\Niko\\Desktop\\Music\\bad romance.mp3 TYPE mpegvideo", NULL, 0, 0);
cout << "OPEN C:\\Users\\Niko\\Desktop\\Music\\bad romance.mp3 TYPE mpegvideo";


mciSendString("CLOSE C:\\Users\\Niko\\Desktop\\Music\\bad romance.mp3 TYPE mpegvideo", NULL, 0, 0);

system("PAUSE");
return 0;
}

oregon
22-03-2010, 19:08
mciSendString("open \"C:\\Users\\Niko\\Desktop\\Music\\bad romance.mp3\" type mpegvideo alias filemp3", NULL, 0, 0);

mciSendString("play filemp3", NULL, 0, 0);

kirakira93
22-03-2010, 20:50
Thanks a lot you are the Best!xD

Loading