1-1 設定compiler-linker winmm
寫一個程式,可撥放聲音檔
程式碼:
#include <windows.h>
int main()
{
PlaySound("07042111.wav",NULL,SND_SYNC);
}
1-2
///week15-2 SND_SYNC要等待同步 VS.
///SND_ASYNC不用等待、不同步
#include <windows.h>
#include <stdio.h>///printf()
int main()
{
printf("現在在PlaySound()前\n");
PlaySound("07042111.wav",NULL,SND_ASYNC);
printf("現在在PlaySiund()後\n");
int N;
scanf("%d",&N);///等你輸入數字
}
1-3
///week15-3 希望能夠播放mp3
///MP3檔案小 vs. WAV檔案大 PlaySound()
///有壓縮/難 原始資料
#include "CMP3_MCI.h"///下載放在同目錄
#include <stdio.h>
CMP3_MCI mp3;
int main()
{
mp3.Load("07042111.mp3");
mp3.Play();
printf("現在正在播放羊的聲音");
int N;///找一個人卡住,不要結束
scanf("%d",&N);
}
沒有留言:
張貼留言