23 #if SDL_AUDIO_DRIVER_ANDROID
28 #include "../SDL_audio_c.h"
31 #include "../../core/android/SDL_android.h"
33 #include <android/log.h>
35 static void * audioDevice;
38 AndroidAUD_OpenDevice(
_THIS,
const char *devname,
int iscapture)
47 if (audioDevice !=
NULL) {
48 return SDL_SetError(
"Only one audio device at a time please!");
54 while (test_format != 0) {
56 this->spec.format = test_format;
62 if (test_format == 0) {
67 if (this->spec.channels > 1) {
68 this->spec.channels = 2;
70 this->spec.channels = 1;
73 if (this->spec.freq < 8000) {
74 this->spec.freq = 8000;
76 if (this->spec.freq > 48000) {
77 this->spec.freq = 48000;
84 if (this->spec.samples == 0) {
93 AndroidAUD_PlayDevice(
_THIS)
99 AndroidAUD_GetDeviceBuf(
_THIS)
112 if (audioDevice ==
this) {
135 "android",
"SDL Android audio driver", AndroidAUD_Init, 0
void(* CloseDevice)(_THIS)
SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format)
Uint8 *(* GetDeviceBuf)(_THIS)
Uint16 SDL_AudioFormat
Audio format flags.
int(* OpenDevice)(_THIS, const char *devname, int iscapture)
SDL_AudioFormat SDL_NextAudioFormat(void)
void(* PlayDevice)(_THIS)
int OnlyHasDefaultOutputDevice
void Android_JNI_CloseAudioDevice()
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
void SDL_CalculateAudioSpec(SDL_AudioSpec *spec)
static void AndroidAUD_CloseDevice(_THIS)
void * Android_JNI_GetAudioBuffer()
void Android_JNI_WriteAudioBuffer()
uint8_t Uint8
An unsigned 8-bit integer type.
int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames)
int OnlyHasDefaultInputDevice
AudioBootStrap ANDROIDAUD_bootstrap