1. with Allegro.Audio_Streams;             use Allegro.Audio_Streams; 
  2. with Allegro.Digital_Samples;           use Allegro.Digital_Samples; 
  3. with System;                            use System; 
  4.  
  5. package Almp3 is 
  6.  
  7.     ALMP3_OK                    : constant Integer :=  0; 
  8.     ALMP3_PLAY_BUFFERTOOSMALL   : constant Integer := -1; 
  9.     ALMP3_POLL_PLAYJUSTFINISHED : constant Integer :=  1; 
  10.     ALMP3_POLL_NOTPLAYING       : constant Integer := -1; 
  11.     ALMP3_POLL_FRAMECORRUPT     : constant Integer := -2; 
  12.     ALMP3_POLL_BUFFERUNDERRUN   : constant Integer := -3; 
  13.     ALMP3_POLL_INTERNALERROR    : constant Integer := -4; 
  14.  
  15.     ALMP3_PLAY_SPEED_NORMAL     : constant Integer := 1000; 
  16.  
  17.     type ALMP3_MP3 is private; 
  18.     type A_mp3 is access all ALMP3_MP3; 
  19.  
  20.     type ALMP3_MP3STREAM is private; 
  21.     type A_mp3stream is access all ALMP3_MP3STREAM; 
  22.  
  23.     --------------------------------------------------------------------------- 
  24.  
  25.     -- Returns the copyright tag for the library. 
  26.     function Almp3_Copyright return String; 
  27.  
  28.     --  Returns the version string for the library: "LibraryName dotted.version" 
  29.     function Almp3_Version return String; 
  30.     pragma Postcondition( Almp3_Version'Result'Length > 0 ); 
  31.  
  32.     --  Creates an ALMP3_MP3 which you'll have to pass to all the other 
  33.     --  functions, where 'data' will be a pointer to the buffer containing 
  34.     --  the mp3 data and 'data_len' the size of this buffer. Note you aren't 
  35.     --  supposed to free this buffer until you have destroyed the ALMP3_MP3. 
  36.  
  37.     -- return values: 
  38.     --  NULL if there ocurred an error (mostly an invalid mp3 data was passed). 
  39.     --  Other value ( != NULL ) otherwise. 
  40.     function Create_mp3( data : Address; data_len : Natural ) return A_mp3; 
  41.     pragma Postcondition( data /= Null_Address ); 
  42.  
  43.     --  Destroys the ALMP3_MP3 automatically stopping it. Note this function 
  44.     --  checks if the 'mp3' pointer is pointing to NULL, so a null pointer 
  45.     --  won't crash the program. 
  46.     procedure Destroy_mp3( mp3 : in out A_mp3 ); 
  47.     pragma Postcondition( mp3 = null ); 
  48.  
  49.     --  Plays the 'mp3' ALMP3_MP3 with the given volume 'vol' (from 0 to 255) 
  50.     --  and panning 'pan' (from 0 to 255, where 0 is full left and 255 is 
  51.     --  full right). 'buffer_len' is the desired size in bytes of the 
  52.     --  buffer where the decoded data will be stored. The bigger, the less 
  53.     --  you'll have to poll the MP3, but the more time you will have to wait 
  54.     --  in order to hear the song start playing. Note that due to some 
  55.     --  mp3 format limitations, the internal (and real) buffer will be 
  56.     --  an aproximation to the 'buffer_len' given. A 'buffer_len' size between 
  57.     --  16384 and 32768 bytes (16kb and 32kb) will do in most cases. 
  58.     -- 
  59.     -- return values: 
  60.     --  ALMP3_OK if no problems. 
  61.     --  ALMP3_PLAY_BUFFERTOOSMALL if the given 'buffer_len' was not big enough. 
  62.     -- 
  63.     -- special note: 
  64.     --  This function also works like a "resume" function, since it 
  65.     --  won't rewind the ALMP3_MP3 automatically. Note that once the ALMP3_MP3 
  66.     --  has reached the end when playing, it will rewind though, stoping the 
  67.     --  ALMP3_MP3 if the loop flag was set at FALSE (see ALMP3_Play_Ex_mp3()) 
  68.     --  or continuing playing it if it was set at TRUE. Also note that this 
  69.     --  automatically stops decoding. 
  70.     function Play_mp3( mp3        : not null A_mp3; 
  71.                        buffer_len : Natural; 
  72.                        vol        : Volume_Type; 
  73.                        pan        : Pan_Type 
  74.                      ) return Integer; 
  75.  
  76.     --  See ALMP3_Play_mp3(). The only addition is the 'speed' that will play the 
  77.     --  ALMP3_MP3 at a given speed (being 1000 = normal speed, 2000 = twice 
  78.     --  fast, 500 = half speed and so on) and a loop flag that can be set to 
  79.     --  not stop the ALMP3_MP3 when it has reached the end, but continue it 
  80.     --  playing from the start. 
  81.     -- 
  82.     -- return values: 
  83.     --  See ALMP3_Play_mp3(). 
  84.     -- 
  85.     -- special note: 
  86.     --  See ALMP3_Play_mp3(). Note that you can change speed, pan, volume, etc 
  87.     --  values to the ALMP3_MP3 many times, but you will need to stop it first. 
  88.     function Play_Ex_mp3( mp3        : not null A_mp3; 
  89.                           buffer_len : Natural; 
  90.                           vol        : Volume_Type; 
  91.                           pan        : Pan_Type; 
  92.                           speed      : Positive; 
  93.                           doloop     : Boolean 
  94.                         ) return Integer; 
  95.  
  96.     --  Stops the ALMP3_MP3 if it was playing. 
  97.     -- 
  98.     -- special note: 
  99.     --  This function also works like a "pause" function, since it won't 
  100.     --  rewind it automatically. 
  101.     procedure Stop_mp3( mp3 : not null A_mp3 ); 
  102.  
  103.     --  Rewinds the ALMP3_MP3 to its start. 
  104.     -- 
  105.     -- special note: 
  106.     --  This function won't automatically stop the ALMP3_MP3 if it was 
  107.     --  already playing. 
  108.     procedure Rewind_mp3( mp3 : not null A_mp3 ); 
  109.  
  110.     --  Does an absolute seek (from start of the mp3), given the new 
  111.     --  position either in frames, msecs, secs or bytes. 
  112.     -- 
  113.     -- special note: 
  114.     --  This function won't stop the ALMP3_MP3 if it was already playing. 
  115.     procedure Seek_Abs_Frames_mp3( mp3 : not null A_mp3; frame : Natural ); 
  116.     procedure Seek_Abs_Msecs_mp3( mp3 : not null A_mp3; msecs : Natural ); 
  117.     procedure Seek_Abs_Secs_mp3( mp3 : not null A_mp3; secs : Natural ); 
  118.     procedure Seek_Abs_Bytes_mp3( mp3 : not null A_mp3; bytes : Natural ); 
  119.  
  120.     --  Does a relative seek (from current position), given the new 
  121.     --  position either in frames, msecs, secs or bytes. 
  122.     -- 
  123.     -- special note: 
  124.     --  This function won't stop the ALMP3_MP3 if it was already playing. 
  125.     procedure Seek_Rel_Frames_mp3( mp3 : not null A_mp3; frame : Integer ); 
  126.     procedure Seek_Rel_Msecs_mp3( mp3 : not null A_mp3; msec : Integer ); 
  127.     procedure Seek_Rel_Secs_mp3( mp3 : not null A_mp3; sec : Integer ); 
  128.     procedure Seek_Rel_Bytes_mp3( mp3 : not null A_mp3; bytes : Integer ); 
  129.  
  130.     --  Adjust the ALMP3_MP3 parameters when it is already playing. 
  131.     procedure Adjust_mp3( mp3    : not null A_mp3; 
  132.                           vol    : Volume_Type; 
  133.                           pan    : Pan_Type; 
  134.                           speed  : Positive; 
  135.                           doloop : Natural ); 
  136.  
  137.     --  This function needs to be called in order to keep the ALMP3_MP3 
  138.     --  playing properly, since the mp3s need to be decoded at real time 
  139.     --  (either that, or to a huge memory buffer). 
  140.     -- 
  141.     -- return values: 
  142.     --  ALMP3_OK if there were no error. 
  143.     --  ALMP3_POLL_PLAYJUSTFINISHED (only once) when the file has JUST 
  144.     --    finished playing. 
  145.     --  ALMP3_POLL_NOTPLAYING if the file is not playing. 
  146.     --  ALMP3_POLL_FRAMECORRUPT if one of the frames is corrupt. 
  147.     --  ALMP3_POLL_INTERNALERROR if an internal error happened. 
  148.     -- 
  149.     -- special note: 
  150.     --  If you don't want (or can't) poll all the time, you can use 
  151.     --  automatic polling (see below), but I don't recommend this since 
  152.     --  this can be very unstable, specially under DOS (although I've 
  153.     --  never experienced such problems myself, but better warn ;). 
  154.     function Poll_mp3( mp3 : not null A_mp3 ) return Integer; 
  155.  
  156.     --  Creates an allegro interrupt that will call poll for this ALMP3_MP3 
  157.     --  each 'speed' msecs. This frees you from calling polling yourself, 
  158.     --  but I recommend this only in the case you can't call poll (because 
  159.     --  of the nature of your program) yourself at regular intervals. 
  160.     procedure Start_Autopoll_mp3( mp3 : not null A_mp3; speed : Positive ); 
  161.  
  162.     --  Destroys the allegro interrupt for that ALMP3_MP3. 
  163.     procedure Stop_Autopoll_mp3( mp3 : not null A_mp3 ); 
  164.  
  165.     --  Returns the ALMP3_MP3 current position either in frames, msecs, secs 
  166.     --  or bytes. 
  167.     function Get_Pos_Frames_mp3( mp3 : not null A_mp3 ) return Natural; 
  168.     function Get_Pos_Msecs_mp3( mp3 : not null A_mp3 ) return Natural; 
  169.     function Get_Pos_Secs_mp3( mp3 : not null A_mp3 ) return Natural; 
  170.     function Get_Pos_Bytes_mp3( mp3 : not null A_mp3 ) return Natural; 
  171.  
  172.     --  Returns the ALMP3_MP3 length either in frames, msecs, secs or bytes. 
  173.     function Get_Length_Frames_mp3( mp3 : not null A_mp3 ) return Natural; 
  174.     function Get_Length_Secs_mp3( mp3 : not null A_mp3 ) return Natural; 
  175.     function Get_Length_Msecs_mp3( mp3 : not null A_mp3 ) return Natural; 
  176.     function Get_Length_Bytes_mp3( mp3 : not null A_mp3 ) return Natural; 
  177.  
  178.     --  Returns the msecs per frame for the given ALMP3_MP3. 
  179.     function Get_Msecs_Per_Frame_mp3( mp3 : A_mp3 ) return Natural; 
  180.  
  181.     --  Returns the ALMP3_MP3 bitrate in bits per second, NOT in kbits. That's 
  182.     --  for example 128000, 64000, 96000, etc. 
  183.     function Get_Bitrate_mp3( mp3 : not null A_mp3 ) return Natural; 
  184.  
  185.     --  Returns 3 on MPEG-audio layer III (this is, mp3) or 2 on MPEG-audio 
  186.     --  layer II (mp2). 
  187.     function Get_Layer_mp3( mp3 : not null A_mp3 ) return Natural; 
  188.  
  189.     function Get_Is_Stereo_mp3( mp3 : not null A_mp3 ) return Natural; 
  190.  
  191.     --  Returns info about the wave. 
  192.     function Get_Wave_Bits_mp3( mp3 : not null A_mp3 ) return Natural; 
  193.     function Get_Wave_Is_Stereo_mp3( mp3 : not null A_mp3 ) return Natural; 
  194.     function Get_Wave_Freq_mp3( mp3 : not null A_mp3 ) return Natural; 
  195.  
  196.     --  Decodes the given ALMP3_MP3 into an Allegro SAMPLE structure. Please 
  197.     --  note for big mp3s this function could generate a HUGE SAMPLE, so it 
  198.     --  is only recommended for very small mp3s like sound effects. 
  199.     -- 
  200.     -- return values: 
  201.     --  NULL on error. 
  202.     --  otherwise not NULL. 
  203.     function Create_Sample_From_mp3( mp3 : not null A_mp3 ) return A_Sample; 
  204.  
  205.     --  Returns a pointer to the piece of wave decoded after each poll, and 
  206.     --  the size of this buffer as well in 'buffer_size' (in bytes). Note this 
  207.     --  function will NOT automatically convert from unsinged to signed 16 bit 
  208.     --  data using the Allegro format instead of the standard format, so this 
  209.     --  data cannot be saved directly into a WAV for example without 
  210.     --  modifications. Also note in order for this function to work, the 
  211.     --  mp3 stream needs to BE playing. 
  212.     -- 
  213.     -- return values: 
  214.     --  NULL if there is no wave being decoded. 
  215.     --  Else the buffer with the wave data. 
  216.     function Get_Output_Wave_mp3( mp3         : not null A_mp3; 
  217.                                   buffer_size : access Natural 
  218.                                 ) return Address; 
  219.  
  220.     --  Returns TRUE if the ALMP3_MP3 is currently being played or FALSE 
  221.     --  if it is not. 
  222.     function Is_Playing_mp3( mp3 : not null A_mp3 ) return Natural; 
  223.  
  224.     --  Self explanatory. Note this function only works when the ALMP3_MP3 
  225.     --  is playing. 
  226.     function Is_Looping_mp3( mp3 : not null A_mp3 ) return Integer; 
  227.  
  228.     --  Returns the allegro AUDIOSTREAM currently being used by the ALMP3_MP3. 
  229.     function Get_Audiostream_mp3( mp3 : not null A_mp3 ) return A_Audiostream; 
  230.  
  231.     --------------------------------------------------------------------------- 
  232.  
  233.     --  See almp3_create_mp3(). The only difference is that 'first_data_buffer' 
  234.     --  contains the very first buffer of len 'data_buffer_len' that you will 
  235.     --  have to give to the MP3STREAM periodically. If after this data, there 
  236.     --  won't be more (this is, this was the last buffer to be processed), 
  237.     --  pass TRUE to 'last_block'. 
  238.     function Create_mp3stream( first_data_buffer : Address; 
  239.                                data_buffer_len, 
  240.                                last_block        : Natural 
  241.                              ) return A_mp3stream; 
  242.     pragma Precondition( first_data_buffer /= Null_Address ); 
  243.  
  244.     function Create_mp3stream_Ex( first_data_buffer : Address; 
  245.                                   data_buffer_len, 
  246.                                   last_block, 
  247.                                   downsample, 
  248.                                   downmix           : Natural 
  249.                                 ) return A_mp3stream; 
  250.     pragma Precondition( first_data_buffer /= Null_Address ); 
  251.  
  252.     -- See almp3_destroy_mp3(). 
  253.     procedure Destroy_mp3stream( mp3 : in out A_mp3stream ); 
  254.     pragma Postcondition( mp3 = null ); 
  255.  
  256.     -- See almp3_play_ex_mp3stream(). 
  257.     function Play_mp3stream( mp3        : not null A_mp3stream; 
  258.                              buffer_len : Natural; 
  259.                              vol        : Volume_Type; 
  260.                              pan        : Pan_Type ) return Integer; 
  261.  
  262.     --  See almp3_play_ex_mp3(). The only difference is that here is no 'loop' 
  263.     --  parameter. To loop an ALMP3_MP3STREAM just destroy the ALMP3_MP3STREAM 
  264.     --  and recreate it (or pass data continuosly). 
  265.     function Play_Ex_mp3stream( mp3        : not null A_mp3stream; 
  266.                                 buffer_len : Natural; 
  267.                                 vol        : Volume_Type; 
  268.                                 pan        : Pan_Type; 
  269.                                 speed      : Positive ) return Integer; 
  270.  
  271.     -- See almp3_stop_mp3(). 
  272.     procedure Stop_mp3stream( mp3 : not null A_mp3stream ); 
  273.  
  274.     --  Adjust the ALMP3_MP3STREAM parameters when it is already playing. 
  275.     --  Note it doesn't include the parameter loop because ALMP3_MP3STREAMs are 
  276.     --  always looping (or better said, they don't have two points to loop 
  277.     --  from/to). 
  278.     procedure Adjust_mp3stream( mp3   : not null A_mp3stream; 
  279.                                 vol   : Volume_Type; 
  280.                                 pan   : Pan_Type; 
  281.                                 speed : Positive ); 
  282.  
  283.     -- See almp3_poll_mp3(). 
  284.     -- return values: 
  285.     --  ALMP3_OK if there were no error. 
  286.     --  ALMP3_POLL_PLAYJUSTFINISHED (only once) when the file has JUST 
  287.     --    finished playing. 
  288.     --  ALMP3_POLL_NOTPLAYING if the file is not playing. 
  289.     --  ALMP3_POLL_FRAMECORRUPT if one of the frames is corrupt. 
  290.     --  ALMP3_POLL_BUFFERUNDERUN if the buffer was exhausted. 
  291.     --  ALMP3_POLL_INTERNALERROR if an internal error happened. 
  292.     function Poll_mp3stream( mp3 : not null A_mp3stream ) return Integer; 
  293.  
  294.     --  See almp3_start_autopoll_mp3(). Note I discourage the use of this 
  295.     --  function with ALMP3_MP3STREAMs since in anyway you'll have to use 
  296.     --  almp3_get_mp3stream_buffer() to send data periodically. 
  297.     procedure Start_Autopoll_mp3stream( mp3 : not null A_mp3stream; speed : Positive ); 
  298.  
  299.     --  See almp3_stop_autopoll_mp3(). 
  300.     procedure Stop_Autopoll_mp3stream( mp3 : not null A_mp3stream ); 
  301.  
  302.     --  If the return value is not NULL, it will return a buffer that you'll 
  303.     --  have to fill with 'buffer_data_len' (from create_mp3stream) bytes MAX 
  304.     --  of new data. You will need to use free_mp3stream_buffer() when you 
  305.     --  are finished with it. 
  306.     -- 
  307.     -- return values: 
  308.     --  NULL if it doesn't need any data yet. 
  309.     --  Else the buffer to be filled. 
  310.     function Get_mp3stream_Buffer( mp3 : not null A_mp3stream ) return Address; 
  311.  
  312.     --  Use whenever you are finished with the buffer returned by 
  313.     --  almp3_get_mp3stream_buffer(). If 'bytes_used' is -1 it will use 
  314.     --  the full buffer and that will mean this is not the last block 
  315.     --  of data, else if 'bytes_used' is a number, it will indicate 
  316.     --  that this is the last buffer and the number of bytes to use from that 
  317.     --  last block. Once this buffer has been played and processed, 
  318.     --  almp3_poll_mp3_stream() will return ALMP3_POLL_JUSTFINISHED. 
  319.     procedure Free_mp3stream_Buffer( mp3 : not null A_mp3stream; bytes_used : Integer ); 
  320.  
  321.     --  Returns the ALMP3_MP3STREAM length either in frames, msecs or secs. 
  322.     --  You will have to pass in 'total_size' the total size (in 
  323.     --  bytes) of the mp3. 
  324.     function Get_Length_Frames_mp3stream( mp3 : not null A_mp3stream; total_size : Natural ) return Natural; 
  325.     function Get_Length_Secs_mp3stream( mp3 : not null A_mp3stream; total_size : Natural ) return Natural; 
  326.     function Get_Length_Msecs_mp3stream( mp3 : not null A_mp3stream; total_size : Natural ) return Natural; 
  327.     function Get_Length_Bytes_mp3stream( mp3 : not null A_mp3stream; total_size : Natural ) return Natural; 
  328.  
  329.     --  See their ALMP3_MP3 equals. 
  330.     function Get_Pos_Frames_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  331.     function Get_Pos_Msecs_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  332.     function Get_Pos_Secs_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  333.     function Get_Pos_Bytes_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  334.     function Get_Msecs_Per_Frame_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  335.     function Get_Bitrate_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  336.     function Get_Layer_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  337.  
  338.     function Get_Is_Stereo_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  339.  
  340.     --  Returns info about the wave. 
  341.     function Get_Wave_Bits_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  342.     function Get_Wave_Is_Stereo_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  343.     function Get_Wave_Freq_mp3stream( mp3 : not null A_mp3stream ) return Natural; 
  344.  
  345.     --  Returns a pointer to the piece of wave decoded after each poll, and 
  346.     --  the size of this buffer as well in 'buffer_size' (in bytes). Note this 
  347.     --  function will NOT automatically convert from unsinged to signed 16 bit 
  348.     --  data using the Allegro format instead of the standard format, so this 
  349.     --  data cannot be saved directly into a WAV for example without 
  350.     --  modifications. Also note in order for this function to work, the 
  351.     --  ALMP3_MP3STREAM needs to BE playing. 
  352.     -- 
  353.     -- return values: 
  354.     --  NULL if there is no wave being decoded. 
  355.     function Get_Output_Wave_mp3stream( mp3         : not null A_mp3stream; 
  356.                                         buffer_size : access Natural ) return Address; 
  357.  
  358.     --  Returns TRUE if the ALMP3_MP3STREAM is currently being played or FALSE 
  359.     --  if it is not. 
  360.     function Is_Playing_mp3stream( mp3 : not null A_mp3stream ) return Integer; 
  361.  
  362.     --  Returns the allegro AUDIOSTREAM currently being used by the 
  363.     --  ALMP3_MP3STREAM. 
  364.     --  Note that when the ALMP3_MP3STREAM isn't being played most probably 
  365.     --  it will return NULL. 
  366.     function Get_Audiostream_mp3stream( mp3 : not null A_mp3stream ) return A_Audiostream; 
  367.  
  368.     --  Returns the position in bytes where you should position your stream 
  369.     --  (file, memory buffer, socket) to continue playing at that mp3 position 
  370.     --  using an absolute (from start position) seeking. 
  371.     --  You need to pass the total size (in bytes) of the stream. 
  372.     -- 
  373.     -- special note: 
  374.     --  This function doesn't perform any operation or change but informs you 
  375.     --  where to read your next chunk of data. 
  376.     function Seek_Abs_Frames_mp3stream( mp3 : not null A_mp3stream; frame, total_size : Natural ) return Natural; 
  377.     function Seek_Abs_Msecs_mp3stream( mp3 : not null A_mp3stream; msecs, total_size : Natural ) return Natural; 
  378.     function Seek_Abs_Secs_mp3stream( mp3 : not null A_mp3stream; msecs, total_size : Natural ) return Natural; 
  379.     function Seek_Abs_Bytes_mp3stream( mp3 : not null A_mp3stream; bytes, total_size : Natural ) return Natural; 
  380.  
  381.     --  Returns the position in bytes where you should position your stream 
  382.     --  (file, memory buffer, socket) to continue playing at that mp3 position 
  383.     --  (using a relative, from current position, seeking). 
  384.     --  You need to pass the total size (in bytes) of the stream. 
  385.     -- 
  386.     -- special note: 
  387.     --  This function doesn't perform any operation or change but informs you 
  388.     --  where to read your next chunk of data. 
  389.     function Seek_Rel_Frames_mp3stream( mp3 : not null A_mp3stream; frame, total_size : Natural ) return Natural; 
  390.     function Seek_Rel_Msecs_mp3stream( mp3 : not null A_mp3stream; msec, total_size : Natural ) return Natural; 
  391.     function Seek_Rel_Secs_mp3stream( mp3 : not null A_mp3stream; sec, total_size : Natural ) return Natural; 
  392.     function Seek_Rel_Bytes_mp3stream( mp3 : not null A_mp3stream; bytes, total_size : Natural ) return Natural; 
  393.  
  394. private 
  395.  
  396.     type ALMP3_MP3 is null record; 
  397.     type ALMP3_MP3STREAM is null record; 
  398.  
  399.     ---------------------------------------------------------------------------- 
  400.  
  401.     pragma Import( C, Create_mp3, "almp3_create_mp3" ); 
  402.     pragma Import( C, Play_mp3, "almp3_play_mp3" ); 
  403.     pragma Import( C, Stop_mp3, "almp3_stop_mp3" ); 
  404.     pragma Import( C, Rewind_mp3, "almp3_rewind_mp3" ); 
  405.     pragma Import( C, Seek_Abs_Frames_mp3, "almp3_seek_abs_frames_mp3" ); 
  406.     pragma Import( C, Seek_Abs_Msecs_mp3, "almp3_seek_abs_msecs_mp3" ); 
  407.     pragma Import( C, Seek_Abs_Secs_mp3, "almp3_seek_abs_secs_mp3" ); 
  408.     pragma Import( C, Seek_Abs_Bytes_mp3, "almp3_seek_abs_bytes_mp3" ); 
  409.     pragma Import( C, Seek_Rel_Frames_mp3, "almp3_seek_rel_frames_mp3" ); 
  410.     pragma Import( C, Seek_Rel_Msecs_mp3, "almp3_seek_rel_msecs_mp3" ); 
  411.     pragma Import( C, Seek_Rel_Secs_mp3, "almp3_seek_rel_secs_mp3" ); 
  412.     pragma Import( C, Seek_Rel_Bytes_mp3, "almp3_seek_rel_bytes_mp3" ); 
  413.     pragma Import( C, Adjust_mp3, "almp3_adjust_mp3" ); 
  414.     pragma Import( C, Poll_mp3, "almp3_poll_mp3" ); 
  415.     pragma Import( C, Start_Autopoll_mp3, "almp3_start_autopoll_mp3" ); 
  416.     pragma Import( C, Stop_Autopoll_mp3, "almp3_stop_autopoll_mp3" ); 
  417.     pragma Import( C, Get_Pos_Frames_mp3, "almp3_get_pos_frames_mp3" ); 
  418.     pragma Import( C, Get_Pos_Msecs_mp3, "almp3_get_pos_msecs_mp3" ); 
  419.     pragma Import( C, Get_Pos_Secs_mp3, "almp3_get_pos_secs_mp3" ); 
  420.     pragma Import( C, Get_Pos_Bytes_mp3, "almp3_get_pos_bytes_mp3" ); 
  421.     pragma Import( C, Get_Length_Frames_mp3, "almp3_get_length_frames_mp3" ); 
  422.     pragma Import( C, Get_Length_Secs_mp3, "almp3_get_length_secs_mp3" ); 
  423.     pragma Import( C, Get_Length_Msecs_mp3, "almp3_get_length_msecs_mp3" ); 
  424.     pragma Import( C, Get_Length_Bytes_mp3, "almp3_get_length_bytes_mp3" ); 
  425.     pragma Import( C, Get_Msecs_Per_Frame_mp3, "almp3_get_msecs_per_frame_mp3" ); 
  426.     pragma Import( C, Get_Bitrate_mp3, "almp3_get_bitrate_mp3" ); 
  427.     pragma Import( C, Get_Layer_mp3, "almp3_get_layer_mp3" ); 
  428.     pragma Import( C, Get_Is_Stereo_mp3, "almp3_get_is_stereo_mp3" ); 
  429.     pragma Import( C, Get_Wave_Bits_mp3, "almp3_get_wave_bits_mp3" ); 
  430.     pragma Import( C, Get_Wave_Is_Stereo_mp3, "almp3_get_wave_is_stereo_mp3" ); 
  431.     pragma Import( C, Get_Wave_Freq_mp3, "almp3_get_wave_freq_mp3" ); 
  432.     pragma Import( C, Create_Sample_From_mp3, "almp3_create_sample_from_mp3" ); 
  433.     pragma Import( C, Get_Output_Wave_mp3, "almp3_get_output_wave_mp3" ); 
  434.     pragma Import( C, Is_Playing_mp3, "almp3_is_playing_mp3" ); 
  435.     pragma Import( C, Is_Looping_mp3, "almp3_is_looping_mp3" ); 
  436.     pragma Import( C, Get_Audiostream_mp3, "almp3_get_audiostream_mp3" ); 
  437.  
  438.     pragma Import( C, Create_mp3stream, "almp3_create_mp3stream" ); 
  439.     pragma Import( C, Create_mp3stream_Ex, "almp3_create_mp3stream_Ex" ); 
  440.     pragma Import( C, Play_mp3stream, "almp3_play_mp3stream" ); 
  441.     pragma Import( C, Play_Ex_mp3stream, "almp3_play_ex_mp3stream" ); 
  442.     pragma Import( C, Stop_mp3stream, "almp3_stop_mp3stream" ); 
  443.     pragma Import( C, Adjust_mp3stream, "almp3_adjust_mp3stream" ); 
  444.     pragma Import( C, Poll_mp3stream, "almp3_poll_mp3stream" ); 
  445.     pragma Import( C, Start_Autopoll_mp3stream, "almp3_start_autopoll_mp3stream" ); 
  446.     pragma Import( C, Stop_Autopoll_mp3stream, "almp3_stop_autopoll_mp3stream" ); 
  447.     pragma Import( C, Get_mp3stream_Buffer, "almp3_get_mp3stream_buffer" ); 
  448.     pragma Import( C, Free_mp3stream_Buffer, "almp3_free_mp3stream_buffer" ); 
  449.     pragma Import( C, Get_Length_Frames_mp3stream, "almp3_get_length_frames_mp3stream" ); 
  450.     pragma Import( C, Get_Length_Secs_mp3stream, "almp3_get_length_secs_mp3stream" ); 
  451.     pragma Import( C, Get_Length_Msecs_mp3stream, "almp3_get_length_msecs_mp3stream" ); 
  452.     pragma Import( C, Get_Length_Bytes_mp3stream, "almp3_get_length_bytes_mp3stream" ); 
  453.     pragma Import( C, Get_Pos_Frames_mp3stream, "almp3_get_pos_frames_mp3stream" ); 
  454.     pragma Import( C, Get_Pos_Msecs_mp3stream, "almp3_get_pos_msecs_mp3stream" ); 
  455.     pragma Import( C, Get_Pos_Secs_mp3stream, "almp3_get_pos_secs_mp3stream" ); 
  456.     pragma Import( C, Get_Pos_Bytes_mp3stream, "almp3_get_pos_bytes_mp3stream" ); 
  457.     pragma Import( C, Get_Msecs_Per_Frame_mp3stream, "almp3_get_msecs_per_frame_mp3stream" ); 
  458.     pragma Import( C, Get_Bitrate_mp3stream, "almp3_get_bitrate_mp3stream" ); 
  459.     pragma Import( C, Get_Layer_mp3stream, "almp3_get_layer_mp3stream" ); 
  460.     pragma Import( C, Get_Is_Stereo_mp3stream, "almp3_get_is_stereo_mp3stream" ); 
  461.     pragma Import( C, Get_Wave_Bits_mp3stream, "almp3_get_wave_bits_mp3stream" ); 
  462.     pragma Import( C, Get_Wave_Is_Stereo_mp3stream, "almp3_get_wave_is_stereo_mp3stream" ); 
  463.     pragma Import( C, Get_Wave_Freq_mp3stream, "almp3_get_wave_freq_mp3stream" ); 
  464.     pragma Import( C, Get_Output_Wave_mp3stream, "almp3_get_output_wave_mp3stream" ); 
  465.     pragma Import( C, Is_Playing_mp3stream, "almp3_is_playing_mp3stream" ); 
  466.     pragma Import( C, Get_Audiostream_mp3stream, "almp3_get_audiostream_mp3stream" ); 
  467.     pragma Import( C, Seek_Abs_Frames_mp3stream, "almp3_seek_abs_frames_mp3stream" ); 
  468.     pragma Import( C, Seek_Abs_Msecs_mp3stream, "almp3_seek_abs_msecs_mp3stream" ); 
  469.     pragma Import( C, Seek_Abs_Secs_mp3stream, "almp3_seek_abs_secs_mp3stream" ); 
  470.     pragma Import( C, Seek_Abs_Bytes_mp3stream, "almp3_seek_abs_bytes_mp3stream" ); 
  471.     pragma Import( C, Seek_Rel_Frames_mp3stream, "almp3_seek_rel_frames_mp3stream" ); 
  472.     pragma Import( C, Seek_Rel_Msecs_mp3stream, "almp3_seek_rel_msecs_mp3stream" ); 
  473.     pragma Import( C, Seek_Rel_Secs_mp3stream, "almp3_seek_rel_secs_mp3stream" ); 
  474.     pragma Import( C, Seek_Rel_Bytes_mp3stream, "almp3_seek_rel_bytes_mp3stream" ); 
  475.  
  476. end Almp3;