照這個設定
#include <windows.h>
#include <stdio.h>
int main()
{
printf("PlaySound()之前\n");
PlaySound("badbad.wav",NULL,SND_SYNC);
printf("PlaySound()之後\n");
}
會有錯誤的聲音
=========================================================================
可以去這個網址下載聲音
#include <windows.h>
#include <stdio.h>
int main()
{
printf("PlaySound()之前\n");
PlaySound("07072028.wav",NULL,SND_SYNC);
printf("PlaySound()之後\n");
}
#include <windows.h>
#include <stdio.h>
int main()
{
PlaySound("do.wav",NULL,SND_SYNC);
PlaySound("re.wav",NULL,SND_SYNC);
PlaySound("mi.wav",NULL,SND_SYNC);
}
會do re mi
#include <stdio.h>
int main()
{
PlaySound("07071147.wav",NULL,SND_ASYNC); ///ASYNC不等待音樂放完
while(1){
printf("請輸入數字: ");
int N;
scanf("%d",&N);
if(N==1) PlaySound("do.wav",NULL,SND_ASYNC);
if(N==2) PlaySound("re.wav",NULL,SND_ASYNC);
if(N==3) PlaySound("mo.wav",NULL,SND_ASYNC);
}
}
#include <stdio.h>
#include "CMP3_MCI.h"
CMP3_MCI mp3;
int main()
{
mp3.load("0531.mp3");
mp3,Play();
printf("隨便輸入數字卡程式");
int n;
scanf("%d",&n);
}
播放mp3檔
沒有留言:
張貼留言