Sitio web de resúmenes de películas - Cine de ética o Películas de ética - Cómo agregar música de fondo en lenguaje c
Cómo agregar música de fondo en lenguaje c
Por ejemplo, puse una canción llamada hello.mp3 en el directorio (jejeje/cúbrete la cara y llora por adele), y luego:
#include?lt; hgt;
#include?lt; windows.hgt;
#include?lt; mmsystem.hgt;
#include?lt;
#include?lt; windows.hgt;
#include?hgt;
#pragma?comment(lib,?" Winmm.lib" )
int?main(int?argc, ?char?**?argv)
{
TCHAR?fileName[]?=?" hola. mp3" ;
TCHAR?shortName[MAX_PATH];
GetShortPathName(fileName,?shortName,?sizeof(shortName)?/?sizeof(TCHAR));
TCHAR?cmd[MAX_PATH 10];
wsprintf(cmd,? "Play?s",?shortName);
mciSendString(cmd, NULL,?0,?NULL );
printf("¿Actualmente? Jugando:? s\n",?cmd);
Dormir(5?*?60?*?1000);
¿volver?
}
Pon una foto para demostrar que realmente está jugando