29 |
#include <ao/ao.h> |
#include <ao/ao.h> |
30 |
#include <sys/time.h> |
#include <sys/time.h> |
31 |
|
|
32 |
#define WAVEOUTBUF 16 |
#define WAVEOUTLEN 1024 |
33 |
|
|
34 |
static ao_device *o_device = NULL; |
static ao_device *o_device = NULL; |
35 |
static int default_driver; |
static int default_driver; |
55 |
format.bits = 16; |
format.bits = 16; |
56 |
format.channels = 2; |
format.channels = 2; |
57 |
format.rate = 44100; |
format.rate = 44100; |
58 |
format.byte_format = AO_FMT_LITTLE; |
format.byte_format = AO_FMT_NATIVE; |
59 |
|
|
60 |
|
|
61 |
o_device = ao_open_live(default_driver, &format, NULL); |
o_device = ao_open_live(default_driver, &format, NULL); |
62 |
if (o_device == NULL) |
if (o_device == NULL) |
97 |
format.bits = pwfx->wBitsPerSample; |
format.bits = pwfx->wBitsPerSample; |
98 |
format.channels = pwfx->nChannels; |
format.channels = pwfx->nChannels; |
99 |
format.rate = 44100; |
format.rate = 44100; |
100 |
format.byte_format = AO_FMT_LITTLE; |
format.byte_format = AO_FMT_NATIVE; |
101 |
|
|
102 |
if (o_device != NULL) |
if (o_device != NULL) |
103 |
ao_close(o_device); |
ao_close(o_device); |
148 |
|
|
149 |
next_tick = rdpsnd_queue_next_tick(); |
next_tick = rdpsnd_queue_next_tick(); |
150 |
|
|
151 |
len = (WAVEOUTBUF > (out->end - out->p)) ? (out->end - out->p) : WAVEOUTBUF; |
len = (WAVEOUTLEN > (out->end - out->p)) ? (out->end - out->p) : WAVEOUTLEN; |
152 |
ao_play(o_device, (char *) out->p, len); |
ao_play(o_device, (char *) out->p, len); |
153 |
out->p += len; |
out->p += len; |
154 |
|
|
195 |
libao_driver.wave_out_play = libao_play; |
libao_driver.wave_out_play = libao_play; |
196 |
libao_driver.name = xstrdup("libao"); |
libao_driver.name = xstrdup("libao"); |
197 |
libao_driver.description = description; |
libao_driver.description = description; |
198 |
libao_driver.need_byteswap_on_be = 0; |
libao_driver.need_byteswap_on_be = 1; |
199 |
|
libao_driver.need_resampling = 1; |
200 |
libao_driver.next = NULL; |
libao_driver.next = NULL; |
201 |
|
|
202 |
ao_initialize(); |
ao_initialize(); |