47 lines
667 B
C
47 lines
667 B
C
|
|
#include <seafood/sound.h>
|
|
#include <seafood/file.h>
|
|
#include <seafood/memory.h>
|
|
#include <assert.h>
|
|
#include <seafood/win32/dsutil.h>
|
|
|
|
extern IDirectSound* directsound;
|
|
|
|
Sound*
|
|
SoundCreate(char* filename)
|
|
{
|
|
Sound* sound = NEW(Sound);
|
|
|
|
assert(sound);
|
|
|
|
sound->wave = SndObjCreate(directsound, filename, 1);
|
|
|
|
assert(sound->wave);
|
|
|
|
return sound;
|
|
}
|
|
|
|
void
|
|
SoundDelete(Sound* sound)
|
|
{
|
|
assert(sound);
|
|
|
|
free(sound);
|
|
}
|
|
|
|
void
|
|
SoundPlay(Sound* sound, int mode)
|
|
{
|
|
assert(sound);
|
|
|
|
SndObjPlay(sound->wave, mode);
|
|
}
|
|
|
|
void
|
|
SoundStop(Sound* sound)
|
|
{
|
|
assert(sound);
|
|
|
|
SndObjStop(sound->wave);
|
|
}
|
|
|