|
| 1 | +#pragma once |
| 2 | +#inclib "allegro_audio" |
| 3 | + |
| 4 | +#include once "allegro5/allegro.bi" |
| 5 | + |
| 6 | +extern "C" |
| 7 | + |
| 8 | +type ALLEGRO_SAMPLE as ALLEGRO_SAMPLE_ |
| 9 | +type ALLEGRO_SAMPLE_INSTANCE as ALLEGRO_SAMPLE_INSTANCE_ |
| 10 | +type ALLEGRO_AUDIO_STREAM as ALLEGRO_AUDIO_STREAM_ |
| 11 | +type ALLEGRO_MIXER as ALLEGRO_MIXER_ |
| 12 | +type ALLEGRO_VOICE as ALLEGRO_VOICE_ |
| 13 | + |
| 14 | +#define __al_included_allegro5_allegro_audio_h |
| 15 | +#define _KCM_STREAM_FEEDER_QUIT_EVENT_TYPE 512 |
| 16 | +#define ALLEGRO_EVENT_AUDIO_STREAM_FRAGMENT 513 |
| 17 | +#define ALLEGRO_EVENT_AUDIO_STREAM_FINISHED 514 |
| 18 | + |
| 19 | +type ALLEGRO_AUDIO_DEPTH as long |
| 20 | +enum |
| 21 | + ALLEGRO_AUDIO_DEPTH_INT8 = &h00 |
| 22 | + ALLEGRO_AUDIO_DEPTH_INT16 = &h01 |
| 23 | + ALLEGRO_AUDIO_DEPTH_INT24 = &h02 |
| 24 | + ALLEGRO_AUDIO_DEPTH_FLOAT32 = &h03 |
| 25 | + ALLEGRO_AUDIO_DEPTH_UNSIGNED = &h08 |
| 26 | + ALLEGRO_AUDIO_DEPTH_UINT8 = ALLEGRO_AUDIO_DEPTH_INT8 or ALLEGRO_AUDIO_DEPTH_UNSIGNED |
| 27 | + ALLEGRO_AUDIO_DEPTH_UINT16 = ALLEGRO_AUDIO_DEPTH_INT16 or ALLEGRO_AUDIO_DEPTH_UNSIGNED |
| 28 | + ALLEGRO_AUDIO_DEPTH_UINT24 = ALLEGRO_AUDIO_DEPTH_INT24 or ALLEGRO_AUDIO_DEPTH_UNSIGNED |
| 29 | +end enum |
| 30 | + |
| 31 | +#define ALLEGRO_MAX_CHANNELS 8 |
| 32 | + |
| 33 | +type ALLEGRO_CHANNEL_CONF as long |
| 34 | +enum |
| 35 | + ALLEGRO_CHANNEL_CONF_1 = &h10 |
| 36 | + ALLEGRO_CHANNEL_CONF_2 = &h20 |
| 37 | + ALLEGRO_CHANNEL_CONF_3 = &h30 |
| 38 | + ALLEGRO_CHANNEL_CONF_4 = &h40 |
| 39 | + ALLEGRO_CHANNEL_CONF_5_1 = &h51 |
| 40 | + ALLEGRO_CHANNEL_CONF_6_1 = &h61 |
| 41 | + ALLEGRO_CHANNEL_CONF_7_1 = &h71 |
| 42 | +end enum |
| 43 | + |
| 44 | +type ALLEGRO_PLAYMODE as long |
| 45 | +enum |
| 46 | + ALLEGRO_PLAYMODE_ONCE = &h100 |
| 47 | + ALLEGRO_PLAYMODE_LOOP = &h101 |
| 48 | + ALLEGRO_PLAYMODE_BIDIR = &h102 |
| 49 | + _ALLEGRO_PLAYMODE_STREAM_ONCE = &h103 |
| 50 | + _ALLEGRO_PLAYMODE_STREAM_ONEDIR = &h104 |
| 51 | +end enum |
| 52 | + |
| 53 | +type ALLEGRO_MIXER_QUALITY as long |
| 54 | +enum |
| 55 | + ALLEGRO_MIXER_QUALITY_POINT = &h110 |
| 56 | + ALLEGRO_MIXER_QUALITY_LINEAR = &h111 |
| 57 | + ALLEGRO_MIXER_QUALITY_CUBIC = &h112 |
| 58 | +end enum |
| 59 | + |
| 60 | +#define ALLEGRO_AUDIO_PAN_NONE (-1000.0f) |
| 61 | + |
| 62 | +type ALLEGRO_SAMPLE_ID |
| 63 | + _index as long |
| 64 | + _id as long |
| 65 | +end type |
| 66 | + |
| 67 | +declare function al_create_sample(byval buf as any ptr, byval samples as ulong, byval freq as ulong, byval depth as ALLEGRO_AUDIO_DEPTH, byval chan_conf as ALLEGRO_CHANNEL_CONF, byval free_buf as byte) as ALLEGRO_SAMPLE ptr |
| 68 | +declare sub al_destroy_sample(byval spl as ALLEGRO_SAMPLE ptr) |
| 69 | +declare function al_create_sample_instance(byval data_ as ALLEGRO_SAMPLE ptr) as ALLEGRO_SAMPLE_INSTANCE ptr |
| 70 | +declare sub al_destroy_sample_instance(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr) |
| 71 | +declare function al_get_sample_frequency(byval spl as const ALLEGRO_SAMPLE ptr) as ulong |
| 72 | +declare function al_get_sample_length(byval spl as const ALLEGRO_SAMPLE ptr) as ulong |
| 73 | +declare function al_get_sample_depth(byval spl as const ALLEGRO_SAMPLE ptr) as ALLEGRO_AUDIO_DEPTH |
| 74 | +declare function al_get_sample_channels(byval spl as const ALLEGRO_SAMPLE ptr) as ALLEGRO_CHANNEL_CONF |
| 75 | +declare function al_get_sample_data(byval spl as const ALLEGRO_SAMPLE ptr) as any ptr |
| 76 | +declare function al_get_sample_instance_frequency(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ulong |
| 77 | +declare function al_get_sample_instance_length(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ulong |
| 78 | +declare function al_get_sample_instance_position(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ulong |
| 79 | +declare function al_get_sample_instance_speed(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as single |
| 80 | +declare function al_get_sample_instance_gain(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as single |
| 81 | +declare function al_get_sample_instance_pan(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as single |
| 82 | +declare function al_get_sample_instance_time(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as single |
| 83 | +declare function al_get_sample_instance_depth(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ALLEGRO_AUDIO_DEPTH |
| 84 | +declare function al_get_sample_instance_channels(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ALLEGRO_CHANNEL_CONF |
| 85 | +declare function al_get_sample_instance_playmode(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as ALLEGRO_PLAYMODE |
| 86 | +declare function al_get_sample_instance_playing(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as byte |
| 87 | +declare function al_get_sample_instance_attached(byval spl as const ALLEGRO_SAMPLE_INSTANCE ptr) as byte |
| 88 | +declare function al_set_sample_instance_position(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val_ as ulong) as byte |
| 89 | +declare function al_set_sample_instance_length(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val_ as ulong) as byte |
| 90 | +declare function al_set_sample_instance_speed(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val_ as single) as byte |
| 91 | +declare function al_set_sample_instance_gain(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val_ as single) as byte |
| 92 | +declare function al_set_sample_instance_pan(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val_ as single) as byte |
| 93 | +declare function al_set_sample_instance_playmode(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val_ as ALLEGRO_PLAYMODE) as byte |
| 94 | +declare function al_set_sample_instance_playing(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval val_ as byte) as byte |
| 95 | +declare function al_detach_sample_instance(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr) as byte |
| 96 | +declare function al_set_sample(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr, byval data_ as ALLEGRO_SAMPLE ptr) as byte |
| 97 | +declare function al_get_sample(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr) as ALLEGRO_SAMPLE ptr |
| 98 | +declare function al_play_sample_instance(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr) as byte |
| 99 | +declare function al_stop_sample_instance(byval spl as ALLEGRO_SAMPLE_INSTANCE ptr) as byte |
| 100 | +declare function al_create_audio_stream(byval buffer_count as uinteger, byval samples as ulong, byval freq as ulong, byval depth as ALLEGRO_AUDIO_DEPTH, byval chan_conf as ALLEGRO_CHANNEL_CONF) as ALLEGRO_AUDIO_STREAM ptr |
| 101 | +declare sub al_destroy_audio_stream(byval stream as ALLEGRO_AUDIO_STREAM ptr) |
| 102 | +declare sub al_drain_audio_stream(byval stream as ALLEGRO_AUDIO_STREAM ptr) |
| 103 | +declare function al_get_audio_stream_frequency(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ulong |
| 104 | +declare function al_get_audio_stream_length(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ulong |
| 105 | +declare function al_get_audio_stream_fragments(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ulong |
| 106 | +declare function al_get_available_audio_stream_fragments(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ulong |
| 107 | +declare function al_get_audio_stream_speed(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as single |
| 108 | +declare function al_get_audio_stream_gain(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as single |
| 109 | +declare function al_get_audio_stream_pan(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as single |
| 110 | +declare function al_get_audio_stream_channels(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ALLEGRO_CHANNEL_CONF |
| 111 | +declare function al_get_audio_stream_depth(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ALLEGRO_AUDIO_DEPTH |
| 112 | +declare function al_get_audio_stream_playmode(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as ALLEGRO_PLAYMODE |
| 113 | +declare function al_get_audio_stream_playing(byval spl as const ALLEGRO_AUDIO_STREAM ptr) as byte |
| 114 | +declare function al_get_audio_stream_attached(byval spl as const ALLEGRO_AUDIO_STREAM ptr) as byte |
| 115 | +declare function al_get_audio_stream_fragment(byval stream as const ALLEGRO_AUDIO_STREAM ptr) as any ptr |
| 116 | +declare function al_set_audio_stream_speed(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val_ as single) as byte |
| 117 | +declare function al_set_audio_stream_gain(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val_ as single) as byte |
| 118 | +declare function al_set_audio_stream_pan(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val_ as single) as byte |
| 119 | +declare function al_set_audio_stream_playmode(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val_ as ALLEGRO_PLAYMODE) as byte |
| 120 | +declare function al_set_audio_stream_playing(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val_ as byte) as byte |
| 121 | +declare function al_detach_audio_stream(byval stream as ALLEGRO_AUDIO_STREAM ptr) as byte |
| 122 | +declare function al_set_audio_stream_fragment(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval val_ as any ptr) as byte |
| 123 | +declare function al_rewind_audio_stream(byval stream as ALLEGRO_AUDIO_STREAM ptr) as byte |
| 124 | +declare function al_seek_audio_stream_secs(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval time_ as double) as byte |
| 125 | +declare function al_get_audio_stream_position_secs(byval stream as ALLEGRO_AUDIO_STREAM ptr) as double |
| 126 | +declare function al_get_audio_stream_length_secs(byval stream as ALLEGRO_AUDIO_STREAM ptr) as double |
| 127 | +declare function al_set_audio_stream_loop_secs(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval start as double, byval end_ as double) as byte |
| 128 | +declare function al_get_audio_stream_event_source(byval stream as ALLEGRO_AUDIO_STREAM ptr) as ALLEGRO_EVENT_SOURCE ptr |
| 129 | +declare function al_create_mixer(byval freq as ulong, byval depth as ALLEGRO_AUDIO_DEPTH, byval chan_conf as ALLEGRO_CHANNEL_CONF) as ALLEGRO_MIXER ptr |
| 130 | +declare sub al_destroy_mixer(byval mixer as ALLEGRO_MIXER ptr) |
| 131 | +declare function al_attach_sample_instance_to_mixer(byval stream as ALLEGRO_SAMPLE_INSTANCE ptr, byval mixer as ALLEGRO_MIXER ptr) as byte |
| 132 | +declare function al_attach_audio_stream_to_mixer(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval mixer as ALLEGRO_MIXER ptr) as byte |
| 133 | +declare function al_attach_mixer_to_mixer(byval stream as ALLEGRO_MIXER ptr, byval mixer as ALLEGRO_MIXER ptr) as byte |
| 134 | +declare function al_set_mixer_postprocess_callback(byval mixer as ALLEGRO_MIXER ptr, byval cb as sub(byval buf as any ptr, byval samples as ulong, byval data_ as any ptr), byval data_ as any ptr) as byte |
| 135 | +declare function al_get_mixer_frequency(byval mixer as const ALLEGRO_MIXER ptr) as ulong |
| 136 | +declare function al_get_mixer_channels(byval mixer as const ALLEGRO_MIXER ptr) as ALLEGRO_CHANNEL_CONF |
| 137 | +declare function al_get_mixer_depth(byval mixer as const ALLEGRO_MIXER ptr) as ALLEGRO_AUDIO_DEPTH |
| 138 | +declare function al_get_mixer_quality(byval mixer as const ALLEGRO_MIXER ptr) as ALLEGRO_MIXER_QUALITY |
| 139 | +declare function al_get_mixer_gain(byval mixer as const ALLEGRO_MIXER ptr) as single |
| 140 | +declare function al_get_mixer_playing(byval mixer as const ALLEGRO_MIXER ptr) as byte |
| 141 | +declare function al_get_mixer_attached(byval mixer as const ALLEGRO_MIXER ptr) as byte |
| 142 | +declare function al_set_mixer_frequency(byval mixer as ALLEGRO_MIXER ptr, byval val_ as ulong) as byte |
| 143 | +declare function al_set_mixer_quality(byval mixer as ALLEGRO_MIXER ptr, byval val_ as ALLEGRO_MIXER_QUALITY) as byte |
| 144 | +declare function al_set_mixer_gain(byval mixer as ALLEGRO_MIXER ptr, byval gain as single) as byte |
| 145 | +declare function al_set_mixer_playing(byval mixer as ALLEGRO_MIXER ptr, byval val_ as byte) as byte |
| 146 | +declare function al_detach_mixer(byval mixer as ALLEGRO_MIXER ptr) as byte |
| 147 | +declare function al_create_voice(byval freq as ulong, byval depth as ALLEGRO_AUDIO_DEPTH, byval chan_conf as ALLEGRO_CHANNEL_CONF) as ALLEGRO_VOICE ptr |
| 148 | +declare sub al_destroy_voice(byval voice as ALLEGRO_VOICE ptr) |
| 149 | +declare function al_attach_sample_instance_to_voice(byval stream as ALLEGRO_SAMPLE_INSTANCE ptr, byval voice as ALLEGRO_VOICE ptr) as byte |
| 150 | +declare function al_attach_audio_stream_to_voice(byval stream as ALLEGRO_AUDIO_STREAM ptr, byval voice as ALLEGRO_VOICE ptr) as byte |
| 151 | +declare function al_attach_mixer_to_voice(byval mixer as ALLEGRO_MIXER ptr, byval voice as ALLEGRO_VOICE ptr) as byte |
| 152 | +declare sub al_detach_voice(byval voice as ALLEGRO_VOICE ptr) |
| 153 | +declare function al_get_voice_frequency(byval voice as const ALLEGRO_VOICE ptr) as ulong |
| 154 | +declare function al_get_voice_position(byval voice as const ALLEGRO_VOICE ptr) as ulong |
| 155 | +declare function al_get_voice_channels(byval voice as const ALLEGRO_VOICE ptr) as ALLEGRO_CHANNEL_CONF |
| 156 | +declare function al_get_voice_depth(byval voice as const ALLEGRO_VOICE ptr) as ALLEGRO_AUDIO_DEPTH |
| 157 | +declare function al_get_voice_playing(byval voice as const ALLEGRO_VOICE ptr) as byte |
| 158 | +declare function al_set_voice_position(byval voice as ALLEGRO_VOICE ptr, byval val_ as ulong) as byte |
| 159 | +declare function al_set_voice_playing(byval voice as ALLEGRO_VOICE ptr, byval val_ as byte) as byte |
| 160 | +declare function al_install_audio() as byte |
| 161 | +declare sub al_uninstall_audio() |
| 162 | +declare function al_is_audio_installed() as byte |
| 163 | +declare function al_get_allegro_audio_version() as ulong |
| 164 | +declare function al_get_channel_count(byval conf as ALLEGRO_CHANNEL_CONF) as uinteger |
| 165 | +declare function al_get_audio_depth_size(byval conf as ALLEGRO_AUDIO_DEPTH) as uinteger |
| 166 | +declare function al_reserve_samples(byval reserve_samples as long) as byte |
| 167 | +declare function al_get_default_mixer() as ALLEGRO_MIXER ptr |
| 168 | +declare function al_set_default_mixer(byval mixer as ALLEGRO_MIXER ptr) as byte |
| 169 | +declare function al_restore_default_mixer() as byte |
| 170 | +declare function al_play_sample(byval data_ as ALLEGRO_SAMPLE ptr, byval gain as single, byval pan as single, byval speed as single, byval loop_ as ALLEGRO_PLAYMODE, byval ret_id as ALLEGRO_SAMPLE_ID ptr) as byte |
| 171 | +declare sub al_stop_sample(byval spl_id as ALLEGRO_SAMPLE_ID ptr) |
| 172 | +declare sub al_stop_samples() |
| 173 | +declare function al_register_sample_loader(byval ext as const zstring ptr, byval loader as function(byval filename as const zstring ptr) as ALLEGRO_SAMPLE ptr) as byte |
| 174 | +declare function al_register_sample_saver(byval ext as const zstring ptr, byval saver as function(byval filename as const zstring ptr, byval spl as ALLEGRO_SAMPLE ptr) as byte) as byte |
| 175 | +declare function al_register_audio_stream_loader(byval ext as const zstring ptr, byval stream_loader as function(byval filename as const zstring ptr, byval buffer_count as uinteger, byval samples as ulong) as ALLEGRO_AUDIO_STREAM ptr) as byte |
| 176 | +declare function al_register_sample_loader_f(byval ext as const zstring ptr, byval loader as function(byval fp as ALLEGRO_FILE ptr) as ALLEGRO_SAMPLE ptr) as byte |
| 177 | +declare function al_register_sample_saver_f(byval ext as const zstring ptr, byval saver as function(byval fp as ALLEGRO_FILE ptr, byval spl as ALLEGRO_SAMPLE ptr) as byte) as byte |
| 178 | +declare function al_register_audio_stream_loader_f(byval ext as const zstring ptr, byval stream_loader as function(byval fp as ALLEGRO_FILE ptr, byval buffer_count as uinteger, byval samples as ulong) as ALLEGRO_AUDIO_STREAM ptr) as byte |
| 179 | +declare function al_load_sample(byval filename as const zstring ptr) as ALLEGRO_SAMPLE ptr |
| 180 | +declare function al_save_sample(byval filename as const zstring ptr, byval spl as ALLEGRO_SAMPLE ptr) as byte |
| 181 | +declare function al_load_audio_stream(byval filename as const zstring ptr, byval buffer_count as uinteger, byval samples as ulong) as ALLEGRO_AUDIO_STREAM ptr |
| 182 | +declare function al_load_sample_f(byval fp as ALLEGRO_FILE ptr, byval ident as const zstring ptr) as ALLEGRO_SAMPLE ptr |
| 183 | +declare function al_save_sample_f(byval fp as ALLEGRO_FILE ptr, byval ident as const zstring ptr, byval spl as ALLEGRO_SAMPLE ptr) as byte |
| 184 | +declare function al_load_audio_stream_f(byval fp as ALLEGRO_FILE ptr, byval ident as const zstring ptr, byval buffer_count as uinteger, byval samples as ulong) as ALLEGRO_AUDIO_STREAM ptr |
| 185 | + |
| 186 | +end extern |
0 commit comments