home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / musica / mpega_library / developer / include / clib / mpega_protos.h
C/C++ Source or Header  |  1998-06-21  |  4KB  |  98 lines

  1. /*------------------------------------------------------------------------------
  2.  
  3.     File    :   MPEGA_protos.h
  4.  
  5.     Author  :   Stéphane TAVENARD
  6.  
  7.     $VER:   MPEGA_protos.h  2.0  (21/06/1998)
  8.  
  9.     (C) Copyright 1997-1998 Stéphane TAVENARD
  10.         All Rights Reserved
  11.  
  12.     #Rev|   Date   |                      Comment
  13.     ----|----------|--------------------------------------------------------
  14.     0   |25/10/1997| Initial revision                                     ST
  15.     1   |21/06/1998| Added MPEGA_scale                                    ST
  16.  
  17.     ------------------------------------------------------------------------
  18.  
  19.     MPEGA decoder library functions prototypes
  20.  
  21. ------------------------------------------------------------------------------*/
  22.  
  23. #ifndef CLIB_MPEGA_PROTOS_H
  24. #define CLIB_MPEGA_PROTOS_H
  25.  
  26. #ifndef LIBRARIES_MPEGA_H
  27. #include <libraries/mpega.h>
  28. #endif
  29.  
  30. MPEGA_STREAM *MPEGA_open( char *stream_name, MPEGA_CTRL *ctrl );
  31. /*--------------------------------------------------------------------------
  32.    Open an MPEG Audio stream
  33.    Inputs: stream_name = name of stream to decode
  34.            ctrl = decoding controls
  35.    Return the mpeg audio stream ptr or NULL if failed to open stream
  36. */
  37.  
  38. void MPEGA_close( MPEGA_STREAM *mpds );
  39. /*--------------------------------------------------------------------------
  40.    Close an MPEG Audio stream
  41.    Input:  mpds =  mpeg audio stream ptr returned by MPEGA_open
  42. */
  43.  
  44. LONG MPEGA_decode_frame( MPEGA_STREAM *mpds, WORD *pcm[ MPEGA_MAX_CHANNELS ] );
  45. /*--------------------------------------------------------------------------
  46.    Decode the current MPEG Audio frame
  47.    Input:  mpds =  mpeg audio stream ptr returned by MPEGA_open
  48.    Output: pcm[] = 16-bit samples
  49.                    pcm[ 0 ] is mono or left voice or channel 1
  50.                    pcm[ 1 ] is right or channel 2
  51.    Return the number of samples or error code:
  52.       MPEGA_ERR_EOF if end of stream
  53.       MPEGA_ERR_BADFRAME if bad frame
  54.  
  55.    Note: pcm[]'s be at least arrays of MPEGA_PCM_SIZE
  56.          number of samples can be 0 if current frame is skipped, in case
  57.          of error in crc or not enough data for decoding (layer III)
  58.          number of samples = 0 does not indicate end of stream !
  59. */
  60.  
  61. LONG MPEGA_seek( MPEGA_STREAM *mpds, ULONG ms_time_position );
  62. /*--------------------------------------------------------------------------
  63.    Seek into an MPEG Audio stream
  64.    Inputs:  mpds = mpeg audio stream ptr returned by MPEGA_open
  65.             ms_time_position = absolute time position in ms
  66.    Return 0 if Ok, MPEGA_ERR_EOF if outside of stream
  67. */
  68.  
  69. LONG MPEGA_time( MPEGA_STREAM *mpds, ULONG *ms_time_position );
  70. /*--------------------------------------------------------------------------
  71.    Get the current time position of an MPEG Audio stream
  72.    Input:  mpds = mpeg audio stream ptr returned by MPEGA_open
  73.    Output: ms_time_position = absolute time position in ms
  74.    Return 0 if Ok
  75. */
  76.  
  77. LONG MPEGA_find_sync( BYTE *buffer, LONG buffer_size );
  78. /*--------------------------------------------------------------------------
  79.    Find an mpeg synchronization pattern in a buffer
  80.    This function can be use to check if a file contains MPEG audio stream
  81.    Inputs: buffer = stream buffer to analyze
  82.            buffer_size = need to know top of buffer (must be >= 4)
  83.    Return the the sync position (>=0) or MPEGA_ERR_NO_SYNC if not found
  84. */
  85.  
  86. LONG MPEGA_scale( MPEGA_STREAM *mpds, LONG scale_percent ); /* #1 */
  87. /*--------------------------------------------------------------------------
  88.    Set the output scale for the current stream
  89.    Avalaible for Version >= 2.0
  90.    Inputs:  mpds = mpeg audio stream ptr returned by MPEGA_open
  91.             scale_percent = scale factor in % to apply to the decoded output
  92.                             100 is the nominal value
  93.    Return 0 if Ok, MPEGA_ERR_BADVALUE if invalid scale
  94. */
  95.  
  96.  
  97. #endif /* CLIB_MPEGA_PROTOS_H */
  98.