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