#ifndef __WZSOUND_H__ #define __WZSOUND_H__ #include #include // 2006.4.10 1005 ////////////////////////////////////////////////////////////////////////// #ifndef SND_PRIORITY #define SND_PRIORITY //////////////////////////// // ÀÌÆåÆ® »ç¿îµå¿¡¸¸ ÇØ´çÇÏ´Â ¿É¼Çµé //////////////////////////// // µ¿ÀÏÇÑ »ç¿îµå¿¡ ´ëÇÑ ÃÖ´ë Ãâ·Â Ƚ¼ö ÁöÁ¤ #define SND_PRIORITY_MUST_PLAY 0 // ¹«Á¦ÇÑ Ãâ·Â #define SND_PRIORITY_SINGLE_INSTANCE 1 // 1°³ ±îÁö¸¸ Ç÷¹ÀÌ #define SND_PRIORITY_DOUBLE_INSTANCE 2 // 2°³ ±îÁö¸¸ Ç÷¹ÀÌ #define SND_PRIORITY_TRIPLE_INSTANCE 3 // 3°³ ±îÁö¸¸ Ç÷¹ÀÌ #define SND_INSTANCE_NOLIMIT SND_PRIORITY_MUST_PLAY #define SND_INSTANCE_1 SND_PRIORITY_SINGLE_INSTANCE #define SND_INSTANCE_2 SND_PRIORITY_DOUBLE_INSTANCE #define SND_INSTANCE_3 SND_PRIORITY_TRIPLE_INSTANCE #define SND_INSTANCE_4 4 #define SND_INSTANCE_5 5 #define SND_INSTANCE_6 6 #define SND_INSTANCE_7 7 #define SND_INSTANCE_8 8 #define SND_INSTANCE_9 9 #define SND_INSTANCE_10 10 //////////////////////////// // ¾Úºñ¾ðÆ® »ç¿îµå¿¡¸¸ ÇØ´çÇÏ´Â ¿É¼Çµé //////////////////////////// #define SND_PRIORITY_OVERLAPPED 0 // Áߺ¹Çؼ­ ¹«Á¶°Ç ¼Ò¸®¸¦ ³½´Ù. #define SND_PRIORITY_PRIMARY 1 // ÀÌ¹Ì ÇØ´ç »ç¿îµå°¡ Ç÷¹ÀÌ ÁßÀ̸é, ÁßÁöÇÏ°í ´Ù½Ã Ç÷¹ÀÌÇÑ´Ù. #define SND_PRIORITY_NODUPLICATE 2 // ÀÌ¹Ì ÇØ´ç »ç¿îµå°¡ Ç÷¹ÀÌ ÁßÀ̸é, Áߺ¹Ç÷¹À̸¦ ÇÏÁö ¾Ê´Â´Ù. #define SND_PRIORITY_EXCLUSIVE 3 // ÀÌ¹Ì Ç÷¹ÀÌÁßÀÎ ¸ðµç ¾Úºñ¾ðÆ® »ç¿îµå¸¦ ÁßÁöÇϰí, ÇØ´ç »ç¿îµå¸¦ Ãâ·ÂÇÑ´Ù. #define SND_PRIORITY_QUEUE 4 // ÇöÀç Ç÷¹ÀÌÁßÀÎ PRIMARY »ç¿îµå°¡ ³¡³ª¸é, ¹Ù·Î µÚÀ̾î Ç÷¹ÀÌÇÑ´Ù. #endif // »ç¿îµå ¿£Áø ÃʱâÈ­¸¦ À§ÇÑ ÀÔ·Â Á¤º¸ typedef struct WZSNDINFO { bool use_secure_filesystem; // ¾ÐÃà ¾Ïȣȭ ÆÄÀÏ ½Ã½ºÅÛÀ» »ç¿ëÇÒÁö ¿©ºÎ bool enable_debugLog; // ºñÁê¾ó ½ºÆ©µð¿À µð¹ö±× â ¶Ç´Â _bin Æú´õ¿¡ µé¾îÀÖ´Â DebugView·Î // µð¹ö±ë ·Î±×¸¦ Ãâ·ÂÇÒÁö¸¦ ÁöÁ¤ ( true or false ) // Á¤½Ä ¸±¸®Áî ¿¡¼­´Â false ·Î ÇÒ°ÍÀ» ±ÇÀåÇÕ´Ï´Ù. //char pszExcelFile[MAX_PATH]; // ¿¢¼¿ ÆÄÀÏ À§Ä¡ char pszConfigFile[MAX_PATH]; // Config Á¤º¸ ÆÄÀÏ À§Ä¡ char pszVoiceFile[MAX_PATH]; // Voice Á¤º¸ ÆÄÀÏ À§Ä¡ char pszMusicFile[MAX_PATH]; // Music Á¤º¸ ÆÄÀÏ À§Ä¡ char pszSoundFile[MAX_PATH]; // Sound Á¤º¸ ÆÄÀÏ À§Ä¡ char pszSecureFileSystem[MAX_PATH]; // ÆÐÅ· ÆÄÀÏ À§Ä¡ (*.wpk Æ÷¸Ë) char pszLocalFileSystem[MAX_PATH]; // ·ÎÄõð½ºÅ©¿¡¼­ »ç¿îµå µ¥ÀÌÅ͸¦ ·ÎµùÇÒ °æ¿ì, »ç¿îµå ·çÆ® °æ·Î¸¦ ÀÔ·ÂÇÑ´Ù. DWORD dwQuality; WZSNDINFO() { use_secure_filesystem = false; enable_debugLog = false; strcpy(pszConfigFile, "Data/Sound/wzsound_config.txt"); strcpy(pszMusicFile, "Data/Sound/wzsound_music.txt"); strcpy(pszSoundFile, "Data/Sound/wzsound_sound.txt"); strcpy(pszVoiceFile, "Data/Sound/wzsound_voice.txt"); strcpy(pszSecureFileSystem, "Data/Sound/sound.wzs"); strcpy(pszLocalFileSystem, "Data/Sound"); dwQuality = 0; // 0: DS3DALG_NO_VIRTUALIZATION // 1: DS3DALG_HRTF_LIGHT // 2: DS3DALG_HRTF_FULL } } WZSNDINFO, *LPWZSNDINFO; ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // I N S T A N C E ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // Description : initialize sound engine, and load sound table and music table // Return type : void int wzsnd_init( LPWZSNDINFO lpWZSNDINFO); // »ç¿îµå ÃʱâÈ­¿¡ »ç¿ëÇÒ ¿É¼Ç Á¤º¸. // Description : uninitialize sound engine // Return type : void void wzsnd_uninit(); // Description : »ç¿îµåÅ×À̺í Á¤º¸¸¦ ´Ù½Ã ·ÎµåÇÕ´Ï´Ù. // ÀÌ ÇÔ¼ö¸¦ ºÎ¸£±â Àü¿¡, ¹Ýµå½Ã loadµÈ »ç¿îµå¸¦ unload ÇϽʽÿä. // Return type : void void wzsnd_reload_soundtable(); // Description : ¹ÂÁ÷ Å×À̺í Á¤º¸¸¦ ´Ù½Ã ·ÎµåÇÕ´Ï´Ù. // Return type : void void wzsnd_reload_musictable(); // ¿ÀºêÁ§Æ®( ambience) »ç¿îµå Å×À̺íÀ» ´Ù½Ã ·ÎµåÇÕ´Ï´Ù. //void wzsnd_reload_objecttable(); // Function name : wzsnd_reload_voicetable // Description : // Return type : void void wzsnd_reload_voicetable(); ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // U I S O U N D ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // Description : precache ui sound samples // Return type : void void wzsnd_load_ui(); // Description : unload ui sound samples // Return type : void void wzsnd_unload_ui(); // Description : play 2D user interface sound sample // Return type : sound handle int wzsnd_play_ui(int index, // sound index in sound_table text script float vol_scale = 1.0f); // multiply default volume(in script) by this factor void wzsnd_stop_ui(int handle); ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // G A M E P L A Y S O U N D ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // Description : precache gameplay sound samples // Return type : void void wzsnd_load_gameplay(); // Description : unload gameplay sound samples // Return type : void void wzsnd_unload_gameplay(); // Description : play 2D gameplay sound sample // Return type : int handle ( sound handle needed to stop, modify this channel if it's looped or has long playtime. ) int wzsnd_play(int index, // sound index which is described in excel file. BOOL bLoop = 0, // looping or not. int maxChannel=-1, // max instance flag // -1 : load the parameter value from excel script // 0 <= : directly input the value, overriding the parameter value written in excel script. float volume_scale=1.0f, // scale default volume by this factor. Default is no scale(1.0f). int frequency=0); // frequency (0: no modulation, 100 ~10000) //////////////////////////////////// // 3D °ÔÀÓ Ç÷¹ÀÌ »ç¿îµå Á¦¾î //////////////////////////////////// // LFR (left-handed coordinate system) #ifndef D3DVECTOR_DEFINED typedef struct _D3DVECTOR { float x; float y; float z; } D3DVECTOR; #define D3DVECTOR_DEFINED #endif typedef struct SND_SOURCEDESC { ///////////////////// // »ç¿îµå ¿ÀºêÁ§Æ® ¹üÀ§ ¼³Á¤ float flRangeFactor; float flMinDistance; float flMaxDistance; float flObjectRadius; // ¿ÀºêÁ§Æ®ÀÇ ¹Ý°æ ///////////////////// // º¼·ý ¼³Á¤ float flVolumeScale; // »ç¿îµå ½ºÅ©¸³Æ®¿¡ Ç¥±âÇÑ µðÆúÆ® º¼·ý¿¡¼­ À½·®À» Ű¿ì°í ½ÍÀ»¶§, // ÃÖÁ¾ º¼·ý = µðÆúÆ® º¼·ý X volume_scale BOOL bForcePlay; // ¿ÀºêÁ§Æ®°¡ ¸®¼­³Ê¿¡¼­ ³Ê¹« ¸Ö°Å³ª, º¼·ý½ºÄÉÀÏÀ» ³Ê¹« ÀÛ°ÔÇØ¼­ À½ÀÌ ¾Èµé¸± °æ¿ì¿¡µµ, // °­Á¦·Î À½À» ³»°í ½ÍÀ»¶§ 1·Î ¼¼ÆÃÇÑ´Ù. // (*ÁÖÀÇ: ¸¹Àº »ç¿îµå¸¦ force=1·Î ¼¼ÆÃÇϸé, °Å¸®°¡ ¸Ö¾îµµ ¼Ò¸®°¡ ¹«Á¶°Ç ³ª±â¶§¹®¿¡ // ¿ÀºêÁ§Æ®°¡ °ÔÀÓ¿¡¼­ ¸¹ÀÌ º¸Àϰæ¿ì ChannelÀÌ ¸ðÀß¶ó ´Ù¸¥ À½ÀÌ ¾È³¯ ¼öµµ ÀÖ´Ù.) // frequency Á¶Àý float flFrequency; SND_SOURCEDESC() { flRangeFactor = 1.0f; // 1.0fÀÌ ¸î ¹ÌÅÍ¿¡ ÇØ´çÇÏ´ÂÁö. (µðÆúÆ®´Â 1m) flMinDistance = -1; // µðÆúÆ®. ¿¢¼¿ ½ºÅ©¸³Æ®¿¡ ÁöÁ¤ÇÑ ¹üÀ§. flMaxDistance = -1; // µðÆúÆ®. ¿¢¼¿ ½ºÅ©¸³Æ®¿¡ ÁöÁ¤ÇÑ ¹üÀ§. flObjectRadius= 0.0f; flVolumeScale = 1.0f; bForcePlay = FALSE; flFrequency = 0.0f; } } SND_SOURCEDESC, *LPSND_SOURCEDESC; typedef const SND_SOURCEDESC *LPCSND_SOURCEDESC; // Description : play mono channel sample by 3d buffer // Return type : int handle ( sound handle needed to stop, modify this channel if it's looped or has long playtime. ) int wzsnd_play_3d( int index, // sound index which is described in excel file. D3DVECTOR* pvListener, // listener position D3DVECTOR* pvPosition, // source position D3DVECTOR* pvVelocity = NULL, // source velocity. Default is no movement {0.0f, 0.0f, 0.0f} // ÃÊ´ç À̵¿ °Å¸® (m/sec)¸¦ Ç¥±âÇÑ´Ù. (Dopler ¿¬»ê¿¡ »ç¿ë) BOOL bLoop = FALSE, // looping or not int maxChannel = -1, // max instance limit // -1 : load the parameter value from excel script // 0 <= : directly input the value, overriding the parameter value written in excel script. LPSND_SOURCEDESC lpDESC = NULL); // advanced option // Description : modulate a playing sound buffer. // Return type : void void wzsnd_update_3d_source(int handle, // sound handle returned by 'wzsnd_play_3d' D3DVECTOR* pvPosition, D3DVECTOR* pvVelocity = NULL, LPSND_SOURCEDESC lpDESC = NULL); void wzsnd_update_listener(D3DVECTOR* pvListener, // listener position D3DVECTOR* pvFront, // listener's normalized front vector D3DVECTOR* pvTop, // listener's normalized top vector D3DVECTOR* pvVelocity = NULL // listener velocity. (Dopler ¿¬»ê¿¡ »ç¿ë) // - default {0.0f, 0.0f, 0.0f} Á¤Áö»óÅÂ. // ÃÊ´ç À̵¿°Å¸®¸¦ Ç¥½Ã. ( 1.0f = 1m ) ); //////////////////////////////////// // °øÅë °ÔÀÓ Ç÷¹ÀÌ »ç¿îµå Á¦¾î //////////////////////////////////// // Description : ÇØ´ç »ç¿îµå¸¦ óÀ½À¸·Î µÇ°¨´Â´Ù. // Return type : void //void wzsnd_rewind(int handle); // Description : ÇØ´ç »ç¿îµå¸¦ ÁßÁö // Return type : void void wzsnd_stop(int handle); // Description : ÇöÀç Ç÷¹ÀÌ ÁßÀÎ ¸ðµç °ÔÀÓ»ç¿îµå¸¦ ÁßÁöÇÑ´Ù. // Return type : void void wzsnd_stop_all(); // Description : ÇØ´ç »ç¿îµå¸¦ ÀϽà Á¤ÁöÇÑ´Ù. // Return type : void void wzsnd_pause(int handle); // Description : ÇöÀç Ç÷¹ÀÌ ÁßÀÎ ¸ðµç °ÔÀÓ»ç¿îµå¸¦ ÀϽÃÁ¤Áö ÇÑ´Ù. // Return type : void void wzsnd_pause_all(); // Description : ÀϽà Á¤ÁöµÈ °ÔÀÓ»ç¿îµå¸¦ ´Ù½Ã Ç÷¹ÀÌ ÇÑ´Ù. // Return type : void void wzsnd_unpause(int handle); // Description : ¸ðµç ÀϽà Á¤ÁöµÈ °ÔÀÓ»ç¿îµå¸¦ ´Ù½Ã Ç÷¹ÀÌ ÇÑ´Ù. // Return type : void void wzsnd_unpause_all(); // Description : ÇØ´ç °ÔÀÓ»ç¿îµåÀÇ º¼·ýÀ» Á¶Á¤ÇÑ´Ù. // Return type : void void wzsnd_set_volume(int handle, float volume); // 0.0f ~ 1.0f // Description : ¸ðµç °ÔÀÓ»ç¿îµåÀÇ º¼·ýÀ» Á¶Á¤ÇÑ´Ù. // Return type : void void wzsnd_set_volume_all(float volume); // Description : ÇØ´ç °ÔÀÓ »ç¿îµåÀÇ ·çÇÁ ¼³Á¤À» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_loop(int handle, BOOL bLoop); // Description : ÇöÀç »ç¿îµåÀÇ Ç÷¹ÀÌ »óŸ¦ ¸®ÅÏ // Return type : int // 0 stopped // 1 playing int wzsnd_getState_sound( int handle); // wzsnd_play ¶Ç´Â wzsnd_play_3d¸¦ È£ÃâÇØ¼­ ³Ñ°Ü¹ÞÀº ÇÚµé ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // AMBIENT S O U N D ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // Description : ¼±ÅÃµÈ ambient sound¸¦ Ç÷¹ÀÌÇÑ´Ù. // Return type : int handle // -1 : error int wzsnd_play_ambi(int index, // ¿¢¼¿ ambient Å×ÀÌºí¿¡ Ç¥±âÇÑ À妽º ¹øÈ£. int priority=SND_PRIORITY_OVERLAPPED, //SND_PRIORITY_OVERLAPPED //SND_PRIORITY_PRIMARY //SND_PRIORITY_NODUPLICATE //SND_PRIORITY_EXCLUSIVE //SND_PRIORITY_QUEUE BOOL bLoop=-1, // TRUE: ·çÇÁ // FALSE: ·çÇÁ ¾ÈÇÔ. // -1: ½ºÅ©¸³Æ®¿¡ ÁöÁ¤ÇÑ ¿É¼Ç´ë·Î ¼öÇà float vol_scale = 1.0f, BOOL fadein = TRUE, // fade in int handle =-1 // cross-fade½Ãų ¿¥ºñ¾ðÆ® »ç¿îµå ÇÚµé (not implemented yet) ); // Description : ¼±ÅÃµÈ ambient sound¸¦ Á¤ÁöÇÑ´Ù. // Return type : void void wzsnd_stop_ambi( int handle, // ¿¢¼¿ ambient Å×ÀÌºí¿¡ Ç¥±âÇÑ À妽º ¹øÈ£. BOOL fadeout = TRUE); // TRUE: ambient sound°¡ FADE µÇ¸é¼­ Á¾·áµÈ´Ù. // FALSE: ambient sound°¡ Áï½Ã Á¾·áµÈ´Ù. // Description : ¸ðµç ambient sound¸¦ Á¾·áÇÑ´Ù. // Return type : void void wzsnd_stop_all_ambi(BOOL fadeout = TRUE); // TRUE: ambient sound°¡ FADE µÇ¸é¼­ Á¾·áµÈ´Ù. // FALSE: ambient sound°¡ Áï½Ã Á¾·áµÈ´Ù. // Description : pause a selected ambient sound // Return type : void void wzsnd_pause_ambi( int handle); // wzsnd_play_ambi ¿¡¼­ ¸®ÅϹÞÀº ÇÚµé // Description : pause all ambient sound // Return type : void void wzsnd_pause_all_ambi(); // Description : unpause a selected ambient sound // Return type : void void wzsnd_unpause_ambi( int handle); // wzsnd_play_ambi ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé // Description : unpause all ambient sound // Return type : void void wzsnd_unpause_all_ambi(); // Description : ¼±ÅÃµÈ ambient soundÀÇ º¼·ýÀ» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_volume_ambi(int handle, // wzsnd_play_ambi ¿¡¼­ ¸®ÅϹÞÀº ÇÚµé float volume); // º¼·ý (0.0f ~1.0f) // Description : ¸ðµç ambient soundÀÇ º¼·ýÀ» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_volume_all_ambi(float volume); // Description : ambient soundÀÇ ¹Ýº¹ ¼³Á¤À» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_loop_ambi(int handle, // wzsnd_play_ambi ¿¡¼­ ¸®ÅϹÞÀº ÇÚµé BOOL bLoop); // ¹Ýº¹ ¿É¼Ç // Description : ÇöÀç ambient soundÀÇ Ç÷¹ÀÌ »óŸ¦ ¸®ÅÏ // Return type : int // 0 stopped // 1 playing // 2 paused int wzsnd_getState_ambi( int handle); // wzsnd_play_ambi ¿¡¼­ ¸®ÅϹÞÀº ÇÚµé ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // VOICE S O U N D ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // Description : ¼±ÅÃµÈ voiceÀ» Ç÷¹ÀÌÇÑ´Ù. // Return type : int handle int wzsnd_play_voice( int index, BOOL bLoop=FALSE, float vol_scale = 1.0f, // ¿¢¼¿ º¸À̽º Å×ÀÌºí¿¡ Ç¥±âÇÑ º¼·ý X vol_sacle = ÃÖÁ¾º¼·ý BOOL fadein = FALSE); // Description : ¼±ÅÃµÈ voiceÀ» Á¤ÁöÇÑ´Ù. // Return type : void void wzsnd_stop_voice( int handle, // wzsnd_play_voice ºÎÅÍ ¸®ÅϹÞÀº Çڵ鰪 BOOL fadeout = TRUE); // 1 voice»ç¿îµå°¡ FADE µÇ¸é¼­ Á¾·áµÈ´Ù. // 0 voice»ç¿îµå°¡ Áï½Ã Á¾·áµÈ´Ù. //-1 DEFAULT (½ºÅ©¸³Æ®¿¡ ÁöÁ¤ÇÑ ¹æ½Ä´ë·Î Á¾·áÇÑ´Ù.) // Description : ¸ðµç voice »ç¿îµå¸¦ Á¾·áÇÑ´Ù. // Return type : void void wzsnd_stop_all_voice( BOOL fadeout = TRUE); // 1 voice»ç¿îµå°¡ FADE µÇ¸é¼­ Á¾·áµÈ´Ù. // 0 voice»ç¿îµå°¡ Áï½Ã Á¾·áµÈ´Ù. // Description : pause a selected audio stream // Return type : void void wzsnd_pause_voice( int handle); // wzsnd_play_voice ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé // Description : pause all audio streams // Return type : void void wzsnd_pause_all_voice(); // Description : unpause a selected audio stream // Return type : void void wzsnd_unpause_voice( int handle); // wzsnd_play_voice ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé // Description : unpause all audio streams // Return type : void void wzsnd_unpause_all_voice(); // Description : ¼±ÅÃµÈ voiceÀÇ º¼·ýÀ» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_volume_voice(int handle, // wzsnd_play_voice ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé float volume); // º¼·ý (0.0f ~1.0f) // Description : ¸ðµç voiceÀÇ º¼·ýÀ» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_volume_all_voice(float volume); // Description : º¸À̽ºÀÇ ¹Ýº¹ ¼³Á¤À» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_loop_voice(int handle, // wzsnd_play_voice ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé BOOL bLoop); // ¹Ýº¹ ¿É¼Ç // Description : ÇöÀç voiceÀÇ Ç÷¹ÀÌ »óŸ¦ ¸®ÅÏ // Return type : int // 0 stopped // 1 playing // 2 paused int wzsnd_getState_voice( int handle); // wzsnd_play_voice ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // B G M S O U N D ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // Description : ¼±ÅÃµÈ BGMÀ» Ç÷¹ÀÌÇÑ´Ù. // Return type : int handle int wzsnd_play_bgm( int index, // ¿¢¼¿ ¹ÂÁ÷ Å×ÀÌºí¿¡ Ç¥±âÇÑ À妽º ¹øÈ£. BOOL bLoop = FALSE, float vol_scale=1.0f, BOOL fadein = TRUE); // Description : ¼±ÅÃµÈ BGMÀ» Á¤ÁöÇÑ´Ù. // Return type : void void wzsnd_stop_bgm( int handle, // ¿¢¼¿ ¹ÂÁ÷ Å×ÀÌºí¿¡ Ç¥±âÇÑ À妽º ¹øÈ£. BOOL fadeout = TRUE); // 1 BGM»ç¿îµå°¡ FADE µÇ¸é¼­ Á¾·áµÈ´Ù. // 0 BGM»ç¿îµå°¡ Áï½Ã Á¾·áµÈ´Ù. //-1 DEFAULT (½ºÅ©¸³Æ®¿¡ ÁöÁ¤ÇÑ ¹æ½Ä´ë·Î Á¾·áÇÑ´Ù.) // Description : ¸ðµç BGM »ç¿îµå¸¦ Á¾·áÇÑ´Ù. // Return type : void void wzsnd_stop_all_bgm( BOOL fadeout = TRUE); // 1 BGM»ç¿îµå°¡ FADE µÇ¸é¼­ Á¾·áµÈ´Ù. // 0 BGM»ç¿îµå°¡ Áï½Ã Á¾·áµÈ´Ù. // Description : pause a selected audio stream // Return type : void void wzsnd_pause_bgm( int handle); // wzsnd_play_bgm ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé // Description : pause all audio streams // Return type : void void wzsnd_pause_all_bgm(); // Description : unpause a selected audio stream // Return type : void void wzsnd_unpause_bgm( int handle); // wzsnd_play_bgm ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé // Description : unpause all audio streams // Return type : void void wzsnd_unpause_all_bgm(); // Description : ¼±ÅÃµÈ BGMÀÇ º¼·ýÀ» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_volume_bgm(int handle, // wzsnd_play_bgm ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé float volume); // º¼·ý (0.0f ~1.0f) // Description : ¸ðµç BGMÀÇ º¼·ýÀ» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_volume_all_bgm(float volume); // Description : ¹ÂÁ÷ÀÇ ¹Ýº¹ ¼³Á¤À» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_loop_bgm(int handle, // wzsnd_play_bgm ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé BOOL bLoop); // ¹Ýº¹ ¿É¼Ç // Description : ÇöÀç BGMÀÇ Ç÷¹ÀÌ »óŸ¦ ¸®ÅÏ // Return type : int // 0 stopped // 1 playing // 2 paused int wzsnd_getState_bgm( int handle); // wzsnd_play_bgm ¿¡¼­ ¸®ÅϹÞÀº ½ºÆ®¸®¹Ö ÇÚµé ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // U T I L I T Y ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// #define MAX_GAMEPLAY_SOUNDS 1000 #define MAX_AMBIENT_SOUNDS 200 typedef struct soundEntry { int index; char pszFilename[MAX_PATH]; } soundEntry; // Description : get list of parsed sound table // Return type : void int wzsnd_get_soundtable(soundEntry* sndEntries); int wzsnd_get_soundtableArray(soundEntry* sndEntries); int wzsnd_get_ambienttable(soundEntry* sndEntries); int wzsnd_get_interfacesoundtable(soundEntry* sndEntries); //////////////////////////////////// // master volume, mute control // Description : ¸¶½ºÅÍ º¼·ýÀ» º¯°æÇÑ´Ù. // Return type : void void wzsnd_set_master_vol(int LeftVol, // left channel volume (min 0 ~ max 100) int RightVol); // right channel volume (min 0 ~ max 100) // Description : ÇöÀç ¸¶½ºÅÍ º¼·ý ¼³Á¤À» °¡Á®¿Â´Ù. // Return type : void void wzsnd_get_master_vol(int* pLeftVol, // left channel volume (min 0 ~ max 100) int* pRightVol); // right channel volume (min 0 ~ max 100) // Description : ¸¶½ºÅÍ À½¼Ò°Å¸¦ ¼¼ÆÃÇÑ´Ù. // Return type : void void wzsnd_set_master_mute(bool mute = true); // true: mute on, false: mute off // Description : ¸¶½ºÅÍ À½¼Ò°Å »óŸ¦ °¡Á®¿Â´Ù. // Return type : void bool wzsnd_get_master_mute(); //////////////////////// // wave mixer volume // // Description : ä³Îº°·Î º¼·ýÀ» ÇÒ´çÇÒ ¼ö ÀÖ´Ù. void wzsnd_set_wav_vol(int LeftVol, // min 0 ~ max 100 int RightVol); // min 0 ~ max 100 void wzsnd_get_wav_vol(int* pLeftVol, // min 0 ~ max 100 int* pRightVol); // min 0 ~ max 100 // wave mute void wzsnd_set_wav_mute(bool mute = true); bool wzsnd_get_wav_mute(); //////////////////////// // input mic recording volume void wzsnd_set_mic_input_vol( DWORD dwVol // min 0 ~ max 100 ); void wzsnd_get_mic_input_vol( DWORD* pdwVol // min 0 ~ max 100 ); // output mic recording volume void wzsnd_set_mic_output_vol( DWORD dwVol // min 0 ~ max 100 ); void wzsnd_get_mic_output_vol( DWORD* pdwVol // min 0 ~ max 100 ); void wzsnd_set_mic_output_mute(bool mute = true); bool wzsnd_get_mic_output_mute(); ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // E N V I R O N M E N T ( EAX ) ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// typedef struct sound_env { unsigned long id; // sound environment ID float volume; float damping; float decay; } sound_env; // Description : set EAX parameters // Return type : void void wzsnd_env_set(sound_env *se); // sound environment typedef enum SND_ENV_ID { SND_ENV_GENERIC, SND_ENV_PADDEDCELL, SND_ENV_ROOM, SND_ENV_BATHROOM, SND_ENV_LIVINGROOM, SND_ENV_STONEROOM, SND_ENV_AUDITORIUM, SND_ENV_CONCERTHALL, SND_ENV_CAVE, SND_ENV_ARENA, SND_ENV_HANGAR, SND_ENV_CARPETEDHALLWAY, SND_ENV_HALLWAY, SND_ENV_STONECORRIDOR, SND_ENV_ALLEY, SND_ENV_FOREST, SND_ENV_CITY, SND_ENV_MOUNTAINS, SND_ENV_QUARRY, SND_ENV_PLAIN, SND_ENV_PARKINGLOT, SND_ENV_SEWERPIPE, SND_ENV_UNDERWATER, SND_ENV_DRUGGED, SND_ENV_DIZZY, SND_ENV_PSYCHOTIC, } SND_ENV_ID; // Description : apply preset EAX parameters // Return type : void void wzsnd_env_set_preset(unsigned long envid); // Description : get current EAX parameters // Return type : void void wzsnd_env_get(sound_env *se); // Description : disable EAX // Return type : void void wzsnd_env_disable(); // Description : check user's hardware support for EAX // Return type : void BOOL wzsnd_env_supported(); //------------------------------------------------------------------------------ void wzsnd_check_channel(); void wzsnd_update_cache(); //!< ÀÏÁ¤ °£°æÀ¸·Î È£Ãâ void wzsnd_cache_maintain_milliseconds_set(int val); int wzsnd_cache_maintain_milliseconds_get(); void wzsnd_cache_on(); void wzsnd_cache_off(); bool wzsnd_cache_is(); int wzsnd_cache_size(); //------------------------------------------------------------------------------ #endif //__WZSOUND_H__