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