5
* Mathias Roslund <vice.emu@amidog.se>
7
* This file is part of VICE, the Versatile Commodore Emulator.
8
* See README for copyright notice.
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
31
typedef signed char s8;
32
typedef unsigned char u8;
35
typedef signed short s16;
36
typedef unsigned short u16;
39
typedef signed long s32;
40
typedef unsigned long u32;
44
typedef signed long long s64;
45
typedef unsigned long long u64;
49
#define AUDIO_MODE_8BIT (0x00) /* 8 bit */
50
#define AUDIO_MODE_16BIT (0x01) /* 16 bit */
51
#define AUDIO_MODE_MONO (0x00) /* mono */
52
#define AUDIO_MODE_STEREO (0x02) /* stereo */
55
#define AUDIO_M8S (AUDIO_MODE_MONO | AUDIO_MODE_8BIT ) /* 8 bit signed, mono */
56
#define AUDIO_M16S (AUDIO_MODE_MONO | AUDIO_MODE_16BIT) /* 16 bit signed, mono */
57
#define AUDIO_S8S (AUDIO_MODE_STEREO | AUDIO_MODE_8BIT ) /* 8 bit signed, stereo */
58
#define AUDIO_S16S (AUDIO_MODE_STEREO | AUDIO_MODE_16BIT) /* 16 bit signed, stereo */
61
#define TIMEBASE (1000000) /* us */
62
#define NOTIME ((s64)-1) /* when no timestamp is available */
66
/* sample functions */
67
extern s32 ahi_open(s32 frequency, u32 mode, s32 fragsize, s32 frags, void (*callback)(s64 time));
68
extern s32 ahi_samples_to_bytes(s32 samples);
69
extern s32 ahi_bytes_to_samples(s32 bytes);
72
extern void ahi_play_samples(SWORD *data, s32 samples, s64 time, s32 wait);
74
extern void ahi_play_samples(void *data, s32 samples, s64 time, s32 wait);
77
extern s32 ahi_samples_buffered(void);
78
extern s32 ahi_samples_free(void);
79
extern void ahi_pause(void);
80
extern void ahi_close(void);
83
#define ahi_play_bytes(data, bytes, time, wait) ahi_play_samples(data, ahi_bytes_to_samples(bytes), time, wait)
84
#define ahi_bytes_buffered() ahi_samples_to_bytes(ahi_samples_buffered())
85
#define ahi_bytes_free() ahi_samples_to_bytes(ahi_samples_free())