annotate src/audio/android/SDL_androidaudio.c @ 5267:b530ef003506

Happy 2011! :)
author Sam Lantinga <slouken@libsdl.org>
date Fri, 11 Feb 2011 22:37:15 -0800
parents 327f181542f1
children
rev   line source
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
1 /*
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
5267
b530ef003506 Happy 2011! :)
Sam Lantinga <slouken@libsdl.org>
parents: 5092
diff changeset
3 Copyright (C) 1997-2011 Sam Lantinga
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
4
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
9
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
13 Lesser General Public License for more details.
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
14
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
18
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
19 Sam Lantinga
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
20 slouken@libsdl.org
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
21 */
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
22 #include "SDL_config.h"
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
23
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
24 /* Output audio to Android */
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
25
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
26 #include "SDL_audio.h"
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
27 #include "../SDL_audio_c.h"
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
28 #include "SDL_androidaudio.h"
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
29
5092
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 4996
diff changeset
30 #include "../../core/android/SDL_android.h"
4724
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
31
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
32 #include <android/log.h>
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
33
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
34 static void * audioDevice;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
35
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
36 static int
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
37 AndroidAUD_OpenDevice(_THIS, const char *devname, int iscapture)
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
38 {
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
39 SDL_AudioFormat test_format;
4724
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
40 int valid_datatype = 0;
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
41
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
42 if (iscapture) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
43 //TODO: implement capture
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
44 SDL_SetError("Capture not supported on Android");
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
45 return 0;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
46 }
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
47
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
48 if (audioDevice != NULL) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
49 SDL_SetError("Only one audio device at a time please!");
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
50 return 0;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
51 }
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
52
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
53 audioDevice = this;
4724
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
54
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
55 this->hidden = SDL_malloc(sizeof(*(this->hidden)));
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
56 if (!this->hidden) {
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
57 SDL_OutOfMemory();
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
58 return 0;
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
59 }
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
60 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
61
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
62 test_format = SDL_FirstAudioFormat(this->spec.format);
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
63 while (test_format != 0) { // no "UNKNOWN" constant
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
64 if ((test_format == AUDIO_U8) || (test_format == AUDIO_S16LSB)) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
65 this->spec.format = test_format;
4724
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
66 break;
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
67 }
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
68 test_format = SDL_NextAudioFormat();
4724
d86332c0fb9b Working on the sound system
Paul Hunkin <paul@bieh.net>
parents: 4718
diff changeset
69 }
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
70
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
71 if (test_format == 0) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
72 // Didn't find a compatible format :(
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
73 SDL_SetError("No compatible audio format!");
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
74 return 0;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
75 }
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
76
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
77 if (this->spec.channels > 1) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
78 this->spec.channels = 2;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
79 } else {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
80 this->spec.channels = 1;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
81 }
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
82
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
83 if (this->spec.freq < 8000) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
84 this->spec.freq = 8000;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
85 }
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
86 if (this->spec.freq > 48000) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
87 this->spec.freq = 48000;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
88 }
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
89
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
90 // TODO: pass in/return a (Java) device ID, also whether we're opening for input or output
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
91 this->spec.samples = Android_JNI_OpenAudioDevice(this->spec.freq, this->spec.format == AUDIO_U8 ? 0 : 1, this->spec.channels, this->spec.samples);
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
92 SDL_CalculateAudioSpec(&this->spec);
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
93
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
94 if (this->spec.samples == 0) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
95 // Init failed?
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
96 SDL_SetError("Java-side initialization failed!");
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
97 return 0;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
98 }
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
99
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
100 return 1;
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
101 }
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
102
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
103 static void
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
104 AndroidAUD_PlayDevice(_THIS)
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
105 {
4996
8d7315668e35 Fixed audio buffer lifecycle and implemented audio shutdown
Sam Lantinga <slouken@libsdl.org>
parents: 4995
diff changeset
106 Android_JNI_WriteAudioBuffer();
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
107 }
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
108
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
109 static Uint8 *
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
110 AndroidAUD_GetDeviceBuf(_THIS)
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
111 {
4996
8d7315668e35 Fixed audio buffer lifecycle and implemented audio shutdown
Sam Lantinga <slouken@libsdl.org>
parents: 4995
diff changeset
112 return Android_JNI_GetAudioBuffer();
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
113 }
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
114
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
115 static void
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
116 AndroidAUD_CloseDevice(_THIS)
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
117 {
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
118 if (this->hidden != NULL) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
119 SDL_free(this->hidden);
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
120 this->hidden = NULL;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
121 }
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
122 Android_JNI_CloseAudioDevice();
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
123
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
124 if (audioDevice == this) {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
125 audioDevice = NULL;
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
126 }
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
127 }
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
128
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
129 static int
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
130 AndroidAUD_Init(SDL_AudioDriverImpl * impl)
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
131 {
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
132 /* Set the function pointers */
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
133 impl->OpenDevice = AndroidAUD_OpenDevice;
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
134 impl->PlayDevice = AndroidAUD_PlayDevice;
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
135 impl->GetDeviceBuf = AndroidAUD_GetDeviceBuf;
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
136 impl->CloseDevice = AndroidAUD_CloseDevice;
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
137
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
138 /* and the capabilities */
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
139 impl->ProvidesOwnCallbackThread = 1;
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
140 impl->HasCaptureSupport = 0; //TODO
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
141 impl->OnlyHasDefaultOutputDevice = 1;
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
142 impl->OnlyHasDefaultInputDevice = 1;
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
143
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
144 return 1; /* this audio target is available. */
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
145 }
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
146
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
147 AudioBootStrap ANDROIDAUD_bootstrap = {
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
148 "android", "SDL Android audio driver", AndroidAUD_Init, 0 /*1? */
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
149 };
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
150
4995
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
151 /* Called by the Java code to start the audio processing on a thread */
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
152 void
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
153 Android_RunAudioThread()
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
154 {
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
155 SDL_RunAudio(audioDevice);
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
156 }
9f9bea41e88f Working audio implementation contributed by Joseph Lunderville
Sam Lantinga <slouken@libsdl.org>
parents: 4989
diff changeset
157
4718
79aa6c61f33b Added stub android sound system
Paul Hunkin <paul@bieh.net>
parents:
diff changeset
158 /* vi: set ts=4 sw=4 expandtab: */