aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDima Zavin <dima@android.com>2011-04-05 16:03:15 -0700
committerDima Zavin <dima@android.com>2011-04-19 23:11:08 -0700
commit7ea20d0cc523eea9a2f849ab53f205b7de79ca85 (patch)
tree7905a969449d2ef09bac6c6e3e13354e4bdb4eda
parent28f86d256e687e12428361ee9396af0994552436 (diff)
downloadquake-7ea20d0cc523eea9a2f849ab53f205b7de79ca85.tar.gz
quake: convert to use new audio.h
Change-Id: I9c183efb844a54d4352d4539e6c7dd0504f19a26 Signed-off-by: Dima Zavin <dima@android.com>
-rw-r--r--quake/src/WinQuake/snd_android.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/quake/src/WinQuake/snd_android.cpp b/quake/src/WinQuake/snd_android.cpp
index f02f900..7072b8d 100644
--- a/quake/src/WinQuake/snd_android.cpp
+++ b/quake/src/WinQuake/snd_android.cpp
@@ -13,6 +13,8 @@
#include <utils/Log.h>
#include <media/AudioTrack.h>
+#include <hardware/audio.h>
+
using namespace android;
static AudioTrack gAudioTrack;
@@ -239,10 +241,10 @@ qboolean SNDDMA_Init(void)
// Initialize the AudioTrack.
status_t result = gAudioTrack.set(
- AudioSystem::DEFAULT, // stream type
+ AUDIO_STREAM_DEFAULT, // stream type
SAMPLE_RATE, // sample rate
- BITS_PER_SAMPLE == 16 ? AudioSystem::PCM_16_BIT : AudioSystem::PCM_8_BIT, // format (8 or 16)
- (CHANNEL_COUNT > 1) ? AudioSystem::CHANNEL_OUT_STEREO : AudioSystem::CHANNEL_OUT_MONO, // channel mask
+ BITS_PER_SAMPLE == 16 ? AUDIO_FORMAT_PCM_16_BIT : AUDIO_FORMAT_PCM_8_BIT, // format (8 or 16)
+ (CHANNEL_COUNT > 1) ? AUDIO_CHANNEL_OUT_STEREO : AUDIO_CHANNEL_OUT_MONO, // channel mask
0, // default buffer size
0, // flags
AndroidQuakeSoundCallback, // callback
@@ -253,7 +255,7 @@ qboolean SNDDMA_Init(void)
if ( result == NO_ERROR ) {
LOGI("AudioTrack latency = %u ms\n", gAudioTrack.latency());
- LOGI("AudioTrack format = %u bits\n", gAudioTrack.format() == AudioSystem::PCM_16_BIT ? 16 : 8);
+ LOGI("AudioTrack format = %u bits\n", gAudioTrack.format() == AUDIO_FORMAT_PCM_16_BIT ? 16 : 8);
LOGI("AudioTrack sample rate = %u Hz\n", gAudioTrack.getSampleRate());
LOGI("AudioTrack frame count = %d\n", int(gAudioTrack.frameCount()));
LOGI("AudioTrack channel count = %d\n", gAudioTrack.channelCount());
@@ -264,7 +266,7 @@ qboolean SNDDMA_Init(void)
memset((void*)&sn, 0, sizeof(sn));
shm->splitbuffer = false; // Not used.
- shm->samplebits = gAudioTrack.format() == AudioSystem::PCM_16_BIT ? 16 : 8;
+ shm->samplebits = gAudioTrack.format() == AUDIO_FORMAT_PCM_16_BIT ? 16 : 8;
shm->speed = gAudioTrack.getSampleRate();
shm->channels = gAudioTrack.channelCount();
shm->samples = TOTAL_BUFFER_SIZE / BYTES_PER_SAMPLE;