-
Notifications
You must be signed in to change notification settings - Fork 55
MTY_AudioCreate
Create an MTY_Audio
context for playback.
MTY_Audio *MTY_AudioCreate(
uint32_t sampleRate,
uint32_t minBuffer,
uint32_t maxBuffer,
uint8_t channels,
const char * deviceID,
bool fallback
);
sampleRate
(uint32_t
)
Audio sample rate in KHz.
minBuffer
(uint32_t
)
The minimum amount of audio in milliseconds that must be queued before playback begins.
maxBuffer
(uint32_t
)
The maximum amount of audio in milliseconds that can be queued before audio begins getting dropped. The queue will flush to zero, then begin building back towards minBuffer
again before playback resumes.
channels
(uint8_t
)
Number of audio channels.
deviceID
(const char *
)
Specify a specific audio device for playback, or NULL
for the default device. Windows only.
fallback
(bool
)
If deviceID
is not NULL
, set to true
to fallback to the default device, or false
to cause this function to fail and return NULL
. Windows only.
MTY_Audio *
On failure, NULL
is returned. Call MTY_GetLog
for details.
The returned MTY_Audio
context must be destroyed with MTY_AudioDestroy
.