======================================================================= FEDSND.DLL Ver 0.10 API Documentation ======================================================================= 1.A present version, the following function are being supported. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundPlay(LPCTSTR lpszFileName, DWORD dwPlayFlag, LPWAVEFORMATEX lpWaveHeader); ----------------------------------------------------------------------- explanation:The WAVE file that was designated with the 1st argument is played. arguments: lpszFileName The WAVE file name that plays is designated. dwPlayFlag It is a performance flag. Any value of the following are possible designated. Value Meaning SND_ASYNC A sound is regenerated to the asynchronous target. This function returns control immediately after the start of sound regeneration. DirectSoundStop is called, to finish the sound that is regenerated to asynchronous target. SND_LOOP Until SoundStop is called sound is regenerated repeatedly. lpWaveHeader I carry out performance with the WAVE format that designated it. For example, if it designates with 16bit Stereo even WAVE of 8bit mono it is played with 16bit streo. Needless to say, soundboard must be corresponding. I carry out a performance with the format that if NULL is designated, in the case that it is not necessary was recorded. It plays with the format until ID is eliminated when it designates it once. Return Value: Between 1 to 31 It is ID of the sound that regenerated. I carry out suspension etc. by using this ID. _ERR_OVER_MAX_PLAYABLE The biggest simultaneous pronunciation number (8 sounds) was exceeded. _ERR_NO_SOUND_REGSTOR_BUFFER It was not able to register to a buffer for the use of registration a/the control table. _ERR_CANT_ALLOCATE_WAVE_BUFFER WAV data was not able to be housed to control table. _ERR_CANT_PLAY It failed to playing. There are several restriction in the WAVE file that can sound with this function. 1.WAVE that can not sound when it is nonexistent via ACM(Audio Compression Manager) can not play. For instance, it is the WAVE file of the sampling rate of 18KHz, For instance, it is the WAVE file that was compressed with True Speech Codec,..etc 2.Middle that is sounding with this API do not play WAVE with "MCI" Yet, API of the API midiStream system that was added with Windows 95, in the case that MIDI is played is used. This is not DirectX. ----------------------------------------------------------------------- WORD WINAPI DirectSoundPlayID(DWORD dwSoundID); ----------------------------------------------------------------------- explanation:The sound that was registered be optional is played. arguments: dwSoundID Designate sound ID that was registered previously. When it is not designating it the ID disregards and return error cord. Return Value: DirectSoundPlay() and it is same. Because it is hypothesizing that this API sends a lot of sounds simultaneously the performance flag like DirectSoundPlay is not setting up. Change a performance flag for performance immediately before by using DirectSoundFlagChange, whether or not a flag is designated when a sound is registered. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundFlagChange(DWORD dwSoundID, DWORD dwFlag); ----------------------------------------------------------------------- explanation:The performance flag of Sound ID that designated it is changed. arguments: dwSoundID Sound ID that wants to change dwFlag The flag after changeing. As for a designated possible argument, observe DirectSoundPlay. Return Value: DWORD The performance flag of one of before is returned. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundGetFlags(DWORD dwSoundID); ----------------------------------------------------------------------- explanation:The performance flag of Sound ID that designated it is returned. Return Value: DWORD The present performance flag is returned. Refer to DirectSoundPlay about this value. ----------------------------------------------------------------------- BOOL WINAPI DirectSoundAllStop(DWORD dwFlags) ----------------------------------------------------------------------- explanation:It carry out all performance suspension of the music that is playing. arguments:None dwFlags A suspension flag is set up. l SND_REMOVE It disappears even from the top of (the memory that eliminates) Sound ID and play and suspend. SND_STOP Sound ID does not eliminate, just carrying out performance suspension. Return Value:TRUE Normally it suspended it. FALSE There is WAVE that is not suspending it normally. Remarks :The Direct Sound stream in all the performances are suspended. In the case that SND_REMOVE is designated it eliminates it from a memory only a "Sound ID in performance". Just as it remained to a memory regarding Sound ID that is not playing it becomes. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundStop(DWORD wSoundID, DWORD dwFlags) ----------------------------------------------------------------------- explanation:I carry out the performance suspension of ID that if it is during a performance designated it. arguments:None arguments: dwFlags A suspension flag is set up. l SND_REMOVE Playing and suspending Sound ID is eliminated. SND_STOP Sound ID does not eliminate, just carrying out performance suspension. Return Value: _ERR_INVALID_SOUNDID It is ineffective sound ID. _ERR_INVALID_FLAG The ineffective flag was designated. _ERR_UNTIL_INITIALIZE An/the initialization is not getting finished. _ERR_DONT_EXIST_SOUNDID The sound of ID that was designated is not registered. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundPargeMemory(DWORD dwSoundID) ----------------------------------------------------------------------- explanation:It carry out the opening of the WAVE data that is remaining on the memory that designated it with dwSoundID. So that it leaves it as much as possible on a memory, unless it opens with this API it does it. arguments:None Return Value:0 Normally it was eliminated. _ERR_DONT_EXIST_SOUNDID The sound of ID that was designated is not registered. _ERR_UNTIL_INITIALIZE An initialization is not getting finished. ----------------------------------------------------------------------- BOOL WINAPI DirectSoundAllPargeMemory(void) ----------------------------------------------------------------------- explanation:It carry out the opening of "all" the WAVE data that are remaining on a memory. It leaves it on a memory, unless it opens with this API. Return Value:TRUE Normally it opened. FALSE There is WAVE that is not opening normally. ----------------------------------------------------------------------- WORD WINAPI DirectSoundCanPlay(void) ----------------------------------------------------------------------- explanation:At present it returns it how many WAVE stream it can regenerate. arguments:None Return Value:Between 1 to 8 number The syntheses to 8 biggest sounds is supported with WAVE in this DLL. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundRegisterSound(LPTSTR lpszFileName, LPWAVEFORMATEX lpWaveHeader) ----------------------------------------------------------------------- explanation:The sound that regenerates is registered previously. Return Value:ID of the sound that registered is returned. arguments: lpszFileName The WAVE file name that registers is designated. lpWaveHeader I carry out a/the performance with the WAVE format that designated it. For example, if it designates with 16bit Stereo even WAVE of 8bit mono it is played with 16bit streo. Needless to say, sound board must be corresponding. I carry out a/the performance with the format that if NULL is designated, in the case that it is not necessary was recorded. Return Value: 1`0x7FFFFFFF Sound ID that was registered _ERR_NO_SOUND_REGSTOR_BUFFER It was not able to register to a buffer for the use of registration a control table. _ERR_CANT_ALLOCATE_WAVE_BUFFER WAV data was not able to be housed to a control table. _ERR_UNTIL_INITIALIZE An initialization is not getting finished. So that I carry out the regeneration of smooth sound simultaneously, by registering the sound to biggest 31 kinds to DLL previously, it does it. This ID is returned with a bit unit. 0 Sound ID that firstly, registered namely becomes and the next is increasing with 2, 4, 8... In this way, such designation becomes possible when it plays with DirectSoundPlayID. DirectSoundPlayID(0x12); It is designated and this the sound that registered to the 2nd and the 5th is regenerated. ----------------------------------------------------------------------- DWORD WINAPI InitDirectSoundControl(HWND hWnd) ----------------------------------------------------------------------- explanation:It carry out initialization etc. of DirectSound. Call once without fail before the use of all API. In the case that it is not calling it all API return _ERR_DIRECT_SOUND_NO_INIT. Return Value:If it is success to call, returns 0.In the case that it failed an error cord is returned. arguments: hWnd The window handle of a parent is handed over. Without fail hand over effective HWND. Because DirectSound does not act well in NULL this function returns an error cord. Return Value: 0 Normal completion _ERR_INVALID_HWND Effective HWND was not designated. _ERR_DIRECT_SOUND_INIT_FAIL Initializatize failure. ----------------------------------------------------------------------- BOOL WINAPI TerminateDirectSoundControl(void) ----------------------------------------------------------------------- explanation:It carry out the completion processing of Direct Sound. Call at the time of the completion of an application. Return Value: TRUE Normal completion FALSE Failure ----------------------------------------------------------------------- WORD WINAPI GetFeDSndVersion(void) ----------------------------------------------------------------------- explanation:The version number of FeDSnd.DLL is returned. Return Value:It is 1.00 if it is 100, 0.01 if it is 1.00. arguments: None Return Value: It houses and returns a minor version to a major version, subordinate position BYTE to upper class BYTE. :0x0103 The version is 1.03. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundSetPan(DWORD dwSoundID, long lPanValue) ----------------------------------------------------------------------- explanation:Pan is set up. Return Value:If it is success 0, an error cord is returned if it is a failure. arguments: dwSoundID Sound ID that wants to change lPanValue I decide the right and left distribution of a volume. -10,000 to 10,000 value can be set up. It becomes the volume of right and left equality with 0. When the value of positive is designated and the voice of a right channel becomes small when the value of negative is designated the voice of a left channel becomes small. It changes 1db with 100 units. Return Value: DWORD In the case that I finished be normal 0 is returned. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundSetVolume(DWORD dwSoundID, long lVol) ----------------------------------------------------------------------- explanation:The volume of ID that designated it is set up. Return Value:If it is success 0, an error cord is returned if it is a failure. arguments: dwSoundID Sound ID that wants to change lVol A volume is designated. 0 to 0000 value can be set up. 0 is default and -10,000 become lowest. The value of positive that shows volume amplification can not set up. It changes 1db with 100 units. Return Value: DWORD In the case that I finished be normal 0 is returned. An/the error cord is returned except for it. ----------------------------------------------------------------------- long WINAPI DirectSoundGetPan(DWORD dwSoundID) ----------------------------------------------------------------------- explanation:The balance of the volume of ID that designated it is returned. Return Value:If it is success 0000 to 10,000 value, an error cord is returned if it is a failure. arguments: dwSoundID Sound ID that wants to acquire it. In the case that plural ID is designated the value of the balance of the smallest ID is returned. Return Value: long The value of the balance of ID that designated it, in the case that I finished be normal is returned. It is -10,000 to 10,000 from value. It is an error cord except for it. ----------------------------------------------------------------------- long WINAPI DirectSoundGetVolume(DWORD dwSoundID) ----------------------------------------------------------------------- explanation:The volume of ID that designated it is returned. Return Value:If it is success -10000 to 0 value, an error cord is returned if it is a failure. arguments: dwSoundID Sound ID that wants to acquire it. In the case that plural ID is designated the volume of the smallest ID is returned. Return Value: long The volume of ID that designated it, in the case that I finished be normal is returned. It is -10,000 to 0 from value. It is an error cord except for it. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundSetFrequency(DWORD dwSoundID, DWORD dwFreq) ----------------------------------------------------------------------- explanation:The regeneration frequency of ID that designated it is set up. Return Value:If it is success 100 to 100,000 value, an error cord is returned if it is a failure. arguments: dwSoundID Sound ID that wants to set up it. dwFreq Regeneration frequency is designated. One hundred to 100,000 from value can be set up. Return Value: long In the case that I finished be normal 0 is returned. It is an error cord except for it. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundGetFrequency(DWORD dwSoundID) ----------------------------------------------------------------------- explanation:The frequency of ID that designated it is returned. Return Value:If it is success 100 to 100,000 value, an error cord is returned if it is a failure. arguments: dwSoundID Sound ID that wants to acquire it. In the case that plural ID is designated the frequency of the smallest ID is returned. Return Value: DWORD The regeneration frequency of ID that designated it, in the case that I finished be normal is returned. It is 100 to 100,000 from value. It is an error cord except for it. ----------------------------------------------------------------------- DWORD WINAPI DirectSoundPlayPanID(DWORD dwSoundID, long lStartPan, long lEndPan, long lStep) ---------------------------------------------------------------------- explanation:WAVE of ID that designated it it moves and plays Panpot. Return Value:If it is success 0, an error cord is returned if it is a failure. arguments: dwSoundID It is Sound ID that wants to play while moving Panpot. lStartPan The position of Panpot at the time of a/the start is designated. -10,000 to 10,000 value are able to be set up. When Panpot is the value of minus the left position, it makes bare the position of the right when it is the value of plus. lEndPan The position of Panpot at the time of completion is designated. -10,000 to 10,000 value it is possible designated. lStep It sets up be dim Panpot the movement with how much unit. In -10,000 to 10,000 ranges it is able to set up it. For instance, lStartPan Panpot moves 0000, lEndPan to the right from the 3dB each left every 83ms, in the case that 10,000, lStep is designated with 300 with WAV in 5.5 seconds. Return Value: DWORD In the case that I finished be normal 0 is returned. It is an error cord except for it. 2.List of error cord _ERR_NO_SOUND_REGSTOR_BUFFER It was not able to register to a buffer for the use of registration a control table. _ERR_CANT_ALLOCATE_WAVE_BUFFER WAV data was not able to be housed to a control table. _ERR_DONT_EXIST_SOUNDID The sound of ID that was designated is not registered. _ERR_DIRECT_SOUND_INIT_FAIL It failed to initialization. _ERR_INVALID_HWND Effective HWND was not designated. _ERR_UNTIL_INITIALIZE An initialization is not getting finished. _ERR_SOUND_ALREADY_REGISTORED The same file has already been registered. _ERR_SOUND_PLAYING File of ID that designated it is during a performance (Error value that is returned when I operate the file in a performance ) _ERR_INVALID_FLAG The ineffective flag was designated. _ERR_INVALID_SOUNDID It is ineffective sound ID. _ERR_OVER_MAX_PLAYABLE The biggest simultaneous pronunciation number was exceeded(max is 8). _ERR_CANT_PLAY It failed to performance. _ERR_CANT_CALL_FUNCTION This function is not able to use in the present condition. _ERR_INVALID_PARAM A parameter is wrong. _ERR_PRIOLITY_NEEDED It is lacking a degree of preference . (Communicate it to me when this error appeared) _ERR_CONTROL_UNABLE Volume, Pan etc. are not able to be used. _ERR_BADFORMAT It is an injustice format. _ERR_OUTOFMEMORY It is insufficient a memory. _ERR_OUTOFRANGEPARAM The range of a parameter is being exceeded. I mistake it and inquire with mail in the following address if there be doubt etc. E-Mail:k-kame@mue.biglobe.ne.jp(Kazushi Kamegawa)