2017年11月23日 星期四
ㄅㄏ的OpenGL_glut_Week_11
mmsystem.h中
PlaySoundA("file.wav", NULL, SND_SYNC);
來播放wav檔
一般來說檔案放在同目錄底下
使用glut時 檔案放在glut的bin裡 或是自己定義路徑
使用"CMP3_MCI.h" 建立 CMP3_MCI 物件來播放mp3檔
#include <GL/glut.h>
#include <stdlib.h>
#include "CMP3_MCI.h"
CMP3_MCI mp3;
int main()
{
mp3.Load("file.mp3");///讀入 mp3檔
mp3.Play();///Play播放mp3檔
///PlaySoundA("file.wav", NULL, SND_SYNC);
printf("現在在待輸入a\n");
int a;
scanf("%d", &a);///等待輸入時,程式還沒結束
}
Processing:
使用Minim
import ddf.minim.*;
Minim minim;
AudioPlayer player;
AudioPlayer player2;
void setup(){
minim = new Minim(this);
player = minim.loadFile("xxx.mp3");
player.play();
}
void draw(){
}
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言