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