6 #define Sleep(x) usleep((x)*1000)
8 #define WIN32_LEAN_AND_MEAN
14 #endif /* __cplusplus */
16 /* Some helper functions to get the name from the channel and type enums. */
17 const char *ChannelsName(ALenum chans
);
18 const char *TypeName(ALenum type
);
20 /* Helpers to convert frame counts and byte lengths. */
21 ALsizei
FramesToBytes(ALsizei size
, ALenum channels
, ALenum type
);
22 ALsizei
BytesToFrames(ALsizei size
, ALenum channels
, ALenum type
);
24 /* Retrieves a compatible buffer format given the channel configuration and
25 * sample type. If an alIsBufferFormatSupportedSOFT-compatible function is
26 * provided, it will be called to find the closest-matching format from
27 * AL_SOFT_buffer_samples. Returns AL_NONE (0) if no supported format can be
29 ALenum
GetFormat(ALenum channels
, ALenum type
, LPALISBUFFERFORMATSUPPORTEDSOFT palIsBufferFormatSupportedSOFT
);
31 /* Loads samples into a buffer using the standard alBufferData call, but with a
32 * LPALBUFFERSAMPLESSOFT-compatible prototype. Assumes internalformat is valid
33 * for alBufferData, and that channels and type match it. */
34 void AL_APIENTRY
wrap_BufferSamples(ALuint buffer
, ALuint samplerate
,
35 ALenum internalformat
, ALsizei samples
,
36 ALenum channels
, ALenum type
,
39 /* Easy device init/deinit functions. InitAL returns 0 on success. */
45 #endif /* __cplusplus */
47 #endif /* ALHELPERS_H */