with Allegro.Digital_Samples; use Allegro.Digital_Samples;
package Allegro.Audio_Streams is
type Audiostream is private;
type A_Audiostream is access all Audiostream;
type Bits_Type is ( Eight_Bits, Sixteen_Bits );
for Bits_Type use (Eight_Bits => 8, Sixteen_Bits => 16);
for Bits_Type'Size use Integer'Size;
procedure Free_Audio_Stream_Buffer( stream : A_Audiostream );
function Get_Audio_Stream_Buffer( stream : not null A_Audiostream ) return Address;
function Play_Audio_Stream( len : Natural;
bits : Bits_Type;
stereo : Integer;
freq : Integer;
vol : Volume_Type;
pan : Pan_Type ) return A_Audiostream;
procedure Stop_Audio_Stream( stream : in out A_Audiostream );
private
type Audiostream is
record
voice : Integer;
samp : A_Sample;
len,
bufcount,
bufnum,
active : Integer;
locked : Address;
end record;
pragma Convention( C, Audiostream );
pragma Import( C, Free_Audio_Stream_Buffer, "free_audio_stream_buffer" );
pragma Import( C, Get_Audio_Stream_Buffer, "get_audio_stream_buffer" );
pragma Import( C, Play_Audio_Stream, "play_audio_stream" );
end Allegro.Audio_Streams;