Blame include/lame.h

Packit 47f805
/*
Packit 47f805
 *	Interface to MP3 LAME encoding engine
Packit 47f805
 *
Packit 47f805
 *	Copyright (c) 1999 Mark Taylor
Packit 47f805
 *
Packit 47f805
 * This library is free software; you can redistribute it and/or
Packit 47f805
 * modify it under the terms of the GNU Library General Public
Packit 47f805
 * License as published by the Free Software Foundation; either
Packit 47f805
 * version 2 of the License, or (at your option) any later version.
Packit 47f805
 *
Packit 47f805
 * This library is distributed in the hope that it will be useful,
Packit 47f805
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 47f805
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 47f805
 * Library General Public License for more details.
Packit 47f805
 *
Packit 47f805
 * You should have received a copy of the GNU Library General Public
Packit 47f805
 * License along with this library; if not, write to the
Packit 47f805
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 47f805
 * Boston, MA 02111-1307, USA.
Packit 47f805
 */
Packit 47f805
Packit 47f805
/* $Id: lame.h,v 1.192 2017/08/31 14:14:46 robert Exp $ */
Packit 47f805
Packit 47f805
#ifndef LAME_LAME_H
Packit 47f805
#define LAME_LAME_H
Packit 47f805
Packit 47f805
/* for size_t typedef */
Packit 47f805
#include <stddef.h>
Packit 47f805
/* for va_list typedef */
Packit 47f805
#include <stdarg.h>
Packit 47f805
/* for FILE typedef, TODO: remove when removing lame_mp3_tags_fid */
Packit 47f805
#include <stdio.h>
Packit 47f805
Packit 47f805
#if defined(__cplusplus)
Packit 47f805
extern "C" {
Packit 47f805
#endif
Packit 47f805
Packit 47f805
typedef void (*lame_report_function)(const char *format, va_list ap);
Packit 47f805
Packit 47f805
#if defined(WIN32) || defined(_WIN32)
Packit 47f805
#undef CDECL
Packit 47f805
#define CDECL __cdecl
Packit 47f805
#else
Packit 47f805
#define CDECL
Packit 47f805
#endif
Packit 47f805
Packit 47f805
#define DEPRECATED_OR_OBSOLETE_CODE_REMOVED 1
Packit 47f805
Packit 47f805
typedef enum vbr_mode_e {
Packit 47f805
  vbr_off=0,
Packit 47f805
  vbr_mt,               /* obsolete, same as vbr_mtrh */
Packit 47f805
  vbr_rh,
Packit 47f805
  vbr_abr,
Packit 47f805
  vbr_mtrh,
Packit 47f805
  vbr_max_indicator,    /* Don't use this! It's used for sanity checks.       */
Packit 47f805
  vbr_default=vbr_mtrh    /* change this to change the default VBR mode of LAME */
Packit 47f805
} vbr_mode;
Packit 47f805
Packit 47f805
Packit 47f805
/* MPEG modes */
Packit 47f805
typedef enum MPEG_mode_e {
Packit 47f805
  STEREO = 0,
Packit 47f805
  JOINT_STEREO,
Packit 47f805
  DUAL_CHANNEL,   /* LAME doesn't supports this! */
Packit 47f805
  MONO,
Packit 47f805
  NOT_SET,
Packit 47f805
  MAX_INDICATOR   /* Don't use this! It's used for sanity checks. */
Packit 47f805
} MPEG_mode;
Packit 47f805
Packit 47f805
/* Padding types */
Packit 47f805
typedef enum Padding_type_e {
Packit 47f805
  PAD_NO = 0,
Packit 47f805
  PAD_ALL,
Packit 47f805
  PAD_ADJUST,
Packit 47f805
  PAD_MAX_INDICATOR   /* Don't use this! It's used for sanity checks. */
Packit 47f805
} Padding_type;
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/*presets*/
Packit 47f805
typedef enum preset_mode_e {
Packit 47f805
    /*values from 8 to 320 should be reserved for abr bitrates*/
Packit 47f805
    /*for abr I'd suggest to directly use the targeted bitrate as a value*/
Packit 47f805
    ABR_8 = 8,
Packit 47f805
    ABR_320 = 320,
Packit 47f805
Packit 47f805
    V9 = 410, /*Vx to match Lame and VBR_xx to match FhG*/
Packit 47f805
    VBR_10 = 410,
Packit 47f805
    V8 = 420,
Packit 47f805
    VBR_20 = 420,
Packit 47f805
    V7 = 430,
Packit 47f805
    VBR_30 = 430,
Packit 47f805
    V6 = 440,
Packit 47f805
    VBR_40 = 440,
Packit 47f805
    V5 = 450,
Packit 47f805
    VBR_50 = 450,
Packit 47f805
    V4 = 460,
Packit 47f805
    VBR_60 = 460,
Packit 47f805
    V3 = 470,
Packit 47f805
    VBR_70 = 470,
Packit 47f805
    V2 = 480,
Packit 47f805
    VBR_80 = 480,
Packit 47f805
    V1 = 490,
Packit 47f805
    VBR_90 = 490,
Packit 47f805
    V0 = 500,
Packit 47f805
    VBR_100 = 500,
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
    /*still there for compatibility*/
Packit 47f805
    R3MIX = 1000,
Packit 47f805
    STANDARD = 1001,
Packit 47f805
    EXTREME = 1002,
Packit 47f805
    INSANE = 1003,
Packit 47f805
    STANDARD_FAST = 1004,
Packit 47f805
    EXTREME_FAST = 1005,
Packit 47f805
    MEDIUM = 1006,
Packit 47f805
    MEDIUM_FAST = 1007
Packit 47f805
} preset_mode;
Packit 47f805
Packit 47f805
Packit 47f805
/*asm optimizations*/
Packit 47f805
typedef enum asm_optimizations_e {
Packit 47f805
    MMX = 1,
Packit 47f805
    AMD_3DNOW = 2,
Packit 47f805
    SSE = 3
Packit 47f805
} asm_optimizations;
Packit 47f805
Packit 47f805
Packit 47f805
/* psychoacoustic model */
Packit 47f805
typedef enum Psy_model_e {
Packit 47f805
    PSY_GPSYCHO = 1,
Packit 47f805
    PSY_NSPSYTUNE = 2
Packit 47f805
} Psy_model;
Packit 47f805
Packit 47f805
Packit 47f805
/* buffer considerations */
Packit 47f805
typedef enum buffer_constraint_e {
Packit 47f805
    MDB_DEFAULT=0,
Packit 47f805
    MDB_STRICT_ISO=1,
Packit 47f805
    MDB_MAXIMUM=2
Packit 47f805
} buffer_constraint;
Packit 47f805
Packit 47f805
Packit 47f805
struct lame_global_struct;
Packit 47f805
typedef struct lame_global_struct lame_global_flags;
Packit 47f805
typedef lame_global_flags *lame_t;
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/***********************************************************************
Packit 47f805
 *
Packit 47f805
 *  The LAME API
Packit 47f805
 *  These functions should be called, in this order, for each
Packit 47f805
 *  MP3 file to be encoded.  See the file "API" for more documentation
Packit 47f805
 *
Packit 47f805
 ***********************************************************************/
Packit 47f805
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * REQUIRED:
Packit 47f805
 * initialize the encoder.  sets default for all encoder parameters,
Packit 47f805
 * returns NULL if some malloc()'s failed
Packit 47f805
 * otherwise returns pointer to structure needed for all future
Packit 47f805
 * API calls.
Packit 47f805
 */
Packit 47f805
lame_global_flags * CDECL lame_init(void);
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
/* obsolete version */
Packit 47f805
int CDECL lame_init_old(lame_global_flags *);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:
Packit 47f805
 * set as needed to override defaults
Packit 47f805
 */
Packit 47f805
Packit 47f805
/********************************************************************
Packit 47f805
 *  input stream description
Packit 47f805
 ***********************************************************************/
Packit 47f805
/* number of samples.  default = 2^32-1   */
Packit 47f805
int CDECL lame_set_num_samples(lame_global_flags *, unsigned long);
Packit 47f805
unsigned long CDECL lame_get_num_samples(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* input sample rate in Hz.  default = 44100hz */
Packit 47f805
int CDECL lame_set_in_samplerate(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_in_samplerate(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* number of channels in input stream. default=2  */
Packit 47f805
int CDECL lame_set_num_channels(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_num_channels(const lame_global_flags *);
Packit 47f805
Packit 47f805
/*
Packit 47f805
  scale the input by this amount before encoding.  default=1
Packit 47f805
  (not used by decoding routines)
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_scale(lame_global_flags *, float);
Packit 47f805
float CDECL lame_get_scale(const lame_global_flags *);
Packit 47f805
Packit 47f805
/*
Packit 47f805
  scale the channel 0 (left) input by this amount before encoding.  default=1
Packit 47f805
  (not used by decoding routines)
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_scale_left(lame_global_flags *, float);
Packit 47f805
float CDECL lame_get_scale_left(const lame_global_flags *);
Packit 47f805
Packit 47f805
/*
Packit 47f805
  scale the channel 1 (right) input by this amount before encoding.  default=1
Packit 47f805
  (not used by decoding routines)
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_scale_right(lame_global_flags *, float);
Packit 47f805
float CDECL lame_get_scale_right(const lame_global_flags *);
Packit 47f805
Packit 47f805
/*
Packit 47f805
  output sample rate in Hz.  default = 0, which means LAME picks best value
Packit 47f805
  based on the amount of compression.  MPEG only allows:
Packit 47f805
  MPEG1    32, 44.1,   48khz
Packit 47f805
  MPEG2    16, 22.05,  24
Packit 47f805
  MPEG2.5   8, 11.025, 12
Packit 47f805
  (not used by decoding routines)
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_out_samplerate(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_out_samplerate(const lame_global_flags *);
Packit 47f805
Packit 47f805
Packit 47f805
/********************************************************************
Packit 47f805
 *  general control parameters
Packit 47f805
 ***********************************************************************/
Packit 47f805
/* 1=cause LAME to collect data for an MP3 frame analyzer. default=0 */
Packit 47f805
int CDECL lame_set_analysis(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_analysis(const lame_global_flags *);
Packit 47f805
Packit 47f805
/*
Packit 47f805
  1 = write a Xing VBR header frame.
Packit 47f805
  default = 1
Packit 47f805
  this variable must have been added by a Hungarian notation Windows programmer :-)
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_bWriteVbrTag(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_bWriteVbrTag(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* 1=decode only.  use lame/mpglib to convert mp3/ogg to wav.  default=0 */
Packit 47f805
int CDECL lame_set_decode_only(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_decode_only(const lame_global_flags *);
Packit 47f805
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
/* 1=encode a Vorbis .ogg file.  default=0 */
Packit 47f805
/* DEPRECATED */
Packit 47f805
int CDECL lame_set_ogg(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_ogg(const lame_global_flags *);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/*
Packit 47f805
  internal algorithm selection.  True quality is determined by the bitrate
Packit 47f805
  but this variable will effect quality by selecting expensive or cheap algorithms.
Packit 47f805
  quality=0..9.  0=best (very slow).  9=worst.
Packit 47f805
  recommended:  2     near-best quality, not too slow
Packit 47f805
                5     good quality, fast
Packit 47f805
                7     ok quality, really fast
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_quality(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_quality(const lame_global_flags *);
Packit 47f805
Packit 47f805
/*
Packit 47f805
  mode = 0,1,2,3 = stereo, jstereo, dual channel (not supported), mono
Packit 47f805
  default: lame picks based on compression ration and input channels
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_mode(lame_global_flags *, MPEG_mode);
Packit 47f805
MPEG_mode CDECL lame_get_mode(const lame_global_flags *);
Packit 47f805
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
/*
Packit 47f805
  mode_automs.  Use a M/S mode with a switching threshold based on
Packit 47f805
  compression ratio
Packit 47f805
  DEPRECATED
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_mode_automs(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_mode_automs(const lame_global_flags *);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/*
Packit 47f805
  force_ms.  Force M/S for all frames.  For testing only.
Packit 47f805
  default = 0 (disabled)
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_force_ms(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_force_ms(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* use free_format?  default = 0 (disabled) */
Packit 47f805
int CDECL lame_set_free_format(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_free_format(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* perform ReplayGain analysis?  default = 0 (disabled) */
Packit 47f805
int CDECL lame_set_findReplayGain(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_findReplayGain(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* decode on the fly. Search for the peak sample. If the ReplayGain
Packit 47f805
 * analysis is enabled then perform the analysis on the decoded data
Packit 47f805
 * stream. default = 0 (disabled)
Packit 47f805
 * NOTE: if this option is set the build-in decoder should not be used */
Packit 47f805
int CDECL lame_set_decode_on_the_fly(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_decode_on_the_fly(const lame_global_flags *);
Packit 47f805
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
/* DEPRECATED: now does the same as lame_set_findReplayGain()
Packit 47f805
   default = 0 (disabled) */
Packit 47f805
int CDECL lame_set_ReplayGain_input(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_ReplayGain_input(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* DEPRECATED: now does the same as
Packit 47f805
   lame_set_decode_on_the_fly() && lame_set_findReplayGain()
Packit 47f805
   default = 0 (disabled) */
Packit 47f805
int CDECL lame_set_ReplayGain_decode(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_ReplayGain_decode(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* DEPRECATED: now does the same as lame_set_decode_on_the_fly()
Packit 47f805
   default = 0 (disabled) */
Packit 47f805
int CDECL lame_set_findPeakSample(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_findPeakSample(const lame_global_flags *);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/* counters for gapless encoding */
Packit 47f805
int CDECL lame_set_nogap_total(lame_global_flags*, int);
Packit 47f805
int CDECL lame_get_nogap_total(const lame_global_flags*);
Packit 47f805
Packit 47f805
int CDECL lame_set_nogap_currentindex(lame_global_flags* , int);
Packit 47f805
int CDECL lame_get_nogap_currentindex(const lame_global_flags*);
Packit 47f805
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:
Packit 47f805
 * Set printf like error/debug/message reporting functions.
Packit 47f805
 * The second argument has to be a pointer to a function which looks like
Packit 47f805
 *   void my_debugf(const char *format, va_list ap)
Packit 47f805
 *   {
Packit 47f805
 *       (void) vfprintf(stdout, format, ap);
Packit 47f805
 *   }
Packit 47f805
 * If you use NULL as the value of the pointer in the set function, the
Packit 47f805
 * lame buildin function will be used (prints to stderr).
Packit 47f805
 * To quiet any output you have to replace the body of the example function
Packit 47f805
 * with just "return;" and use it in the set function.
Packit 47f805
 */
Packit 47f805
int CDECL lame_set_errorf(lame_global_flags *, lame_report_function);
Packit 47f805
int CDECL lame_set_debugf(lame_global_flags *, lame_report_function);
Packit 47f805
int CDECL lame_set_msgf  (lame_global_flags *, lame_report_function);
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/* set one of brate compression ratio.  default is compression ratio of 11.  */
Packit 47f805
int CDECL lame_set_brate(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_brate(const lame_global_flags *);
Packit 47f805
int CDECL lame_set_compression_ratio(lame_global_flags *, float);
Packit 47f805
float CDECL lame_get_compression_ratio(const lame_global_flags *);
Packit 47f805
Packit 47f805
Packit 47f805
int CDECL lame_set_preset( lame_global_flags*  gfp, int );
Packit 47f805
int CDECL lame_set_asm_optimizations( lame_global_flags*  gfp, int, int );
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/********************************************************************
Packit 47f805
 *  frame params
Packit 47f805
 ***********************************************************************/
Packit 47f805
/* mark as copyright.  default=0 */
Packit 47f805
int CDECL lame_set_copyright(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_copyright(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* mark as original.  default=1 */
Packit 47f805
int CDECL lame_set_original(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_original(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* error_protection.  Use 2 bytes from each frame for CRC checksum. default=0 */
Packit 47f805
int CDECL lame_set_error_protection(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_error_protection(const lame_global_flags *);
Packit 47f805
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
/* padding_type. 0=pad no frames  1=pad all frames 2=adjust padding(default) */
Packit 47f805
int CDECL lame_set_padding_type(lame_global_flags *, Padding_type);
Packit 47f805
Padding_type CDECL lame_get_padding_type(const lame_global_flags *);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/* MP3 'private extension' bit  Meaningless.  default=0 */
Packit 47f805
int CDECL lame_set_extension(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_extension(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* enforce strict ISO compliance.  default=0 */
Packit 47f805
int CDECL lame_set_strict_ISO(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_strict_ISO(const lame_global_flags *);
Packit 47f805
Packit 47f805
Packit 47f805
/********************************************************************
Packit 47f805
 * quantization/noise shaping
Packit 47f805
 ***********************************************************************/
Packit 47f805
Packit 47f805
/* disable the bit reservoir. For testing only. default=0 */
Packit 47f805
int CDECL lame_set_disable_reservoir(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_disable_reservoir(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* select a different "best quantization" function. default=0  */
Packit 47f805
int CDECL lame_set_quant_comp(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_quant_comp(const lame_global_flags *);
Packit 47f805
int CDECL lame_set_quant_comp_short(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_quant_comp_short(const lame_global_flags *);
Packit 47f805
Packit 47f805
int CDECL lame_set_experimentalX(lame_global_flags *, int); /* compatibility*/
Packit 47f805
int CDECL lame_get_experimentalX(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* another experimental option.  for testing only */
Packit 47f805
int CDECL lame_set_experimentalY(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_experimentalY(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* another experimental option.  for testing only */
Packit 47f805
int CDECL lame_set_experimentalZ(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_experimentalZ(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* Naoki's psycho acoustic model.  default=0 */
Packit 47f805
int CDECL lame_set_exp_nspsytune(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_exp_nspsytune(const lame_global_flags *);
Packit 47f805
Packit 47f805
void CDECL lame_set_msfix(lame_global_flags *, double);
Packit 47f805
float CDECL lame_get_msfix(const lame_global_flags *);
Packit 47f805
Packit 47f805
Packit 47f805
/********************************************************************
Packit 47f805
 * VBR control
Packit 47f805
 ***********************************************************************/
Packit 47f805
/* Types of VBR.  default = vbr_off = CBR */
Packit 47f805
int CDECL lame_set_VBR(lame_global_flags *, vbr_mode);
Packit 47f805
vbr_mode CDECL lame_get_VBR(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* VBR quality level.  0=highest  9=lowest  */
Packit 47f805
int CDECL lame_set_VBR_q(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_VBR_q(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* VBR quality level.  0=highest  9=lowest, Range [0,...,10[  */
Packit 47f805
int CDECL lame_set_VBR_quality(lame_global_flags *, float);
Packit 47f805
float CDECL lame_get_VBR_quality(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* Ignored except for VBR=vbr_abr (ABR mode) */
Packit 47f805
int CDECL lame_set_VBR_mean_bitrate_kbps(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_VBR_mean_bitrate_kbps(const lame_global_flags *);
Packit 47f805
Packit 47f805
int CDECL lame_set_VBR_min_bitrate_kbps(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_VBR_min_bitrate_kbps(const lame_global_flags *);
Packit 47f805
Packit 47f805
int CDECL lame_set_VBR_max_bitrate_kbps(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_VBR_max_bitrate_kbps(const lame_global_flags *);
Packit 47f805
Packit 47f805
/*
Packit 47f805
  1=strictly enforce VBR_min_bitrate.  Normally it will be violated for
Packit 47f805
  analog silence
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_VBR_hard_min(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_VBR_hard_min(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* for preset */
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
int CDECL lame_set_preset_expopts(lame_global_flags *, int);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/********************************************************************
Packit 47f805
 * Filtering control
Packit 47f805
 ***********************************************************************/
Packit 47f805
/* freq in Hz to apply lowpass. Default = 0 = lame chooses.  -1 = disabled */
Packit 47f805
int CDECL lame_set_lowpassfreq(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_lowpassfreq(const lame_global_flags *);
Packit 47f805
/* width of transition band, in Hz.  Default = one polyphase filter band */
Packit 47f805
int CDECL lame_set_lowpasswidth(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_lowpasswidth(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* freq in Hz to apply highpass. Default = 0 = lame chooses.  -1 = disabled */
Packit 47f805
int CDECL lame_set_highpassfreq(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_highpassfreq(const lame_global_flags *);
Packit 47f805
/* width of transition band, in Hz.  Default = one polyphase filter band */
Packit 47f805
int CDECL lame_set_highpasswidth(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_highpasswidth(const lame_global_flags *);
Packit 47f805
Packit 47f805
Packit 47f805
/********************************************************************
Packit 47f805
 * psycho acoustics and other arguments which you should not change
Packit 47f805
 * unless you know what you are doing
Packit 47f805
 ***********************************************************************/
Packit 47f805
Packit 47f805
/* only use ATH for masking */
Packit 47f805
int CDECL lame_set_ATHonly(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_ATHonly(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* only use ATH for short blocks */
Packit 47f805
int CDECL lame_set_ATHshort(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_ATHshort(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* disable ATH */
Packit 47f805
int CDECL lame_set_noATH(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_noATH(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* select ATH formula */
Packit 47f805
int CDECL lame_set_ATHtype(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_ATHtype(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* lower ATH by this many db */
Packit 47f805
int CDECL lame_set_ATHlower(lame_global_flags *, float);
Packit 47f805
float CDECL lame_get_ATHlower(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* select ATH adaptive adjustment type */
Packit 47f805
int CDECL lame_set_athaa_type( lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_athaa_type( const lame_global_flags *);
Packit 47f805
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
/* select the loudness approximation used by the ATH adaptive auto-leveling  */
Packit 47f805
int CDECL lame_set_athaa_loudapprox( lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_athaa_loudapprox( const lame_global_flags *);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/* adjust (in dB) the point below which adaptive ATH level adjustment occurs */
Packit 47f805
int CDECL lame_set_athaa_sensitivity( lame_global_flags *, float);
Packit 47f805
float CDECL lame_get_athaa_sensitivity( const lame_global_flags* );
Packit 47f805
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
/* OBSOLETE: predictability limit (ISO tonality formula) */
Packit 47f805
int CDECL lame_set_cwlimit(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_cwlimit(const lame_global_flags *);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/*
Packit 47f805
  allow blocktypes to differ between channels?
Packit 47f805
  default: 0 for jstereo, 1 for stereo
Packit 47f805
*/
Packit 47f805
int CDECL lame_set_allow_diff_short(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_allow_diff_short(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* use temporal masking effect (default = 1) */
Packit 47f805
int CDECL lame_set_useTemporal(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_useTemporal(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* use temporal masking effect (default = 1) */
Packit 47f805
int CDECL lame_set_interChRatio(lame_global_flags *, float);
Packit 47f805
float CDECL lame_get_interChRatio(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* disable short blocks */
Packit 47f805
int CDECL lame_set_no_short_blocks(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_no_short_blocks(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* force short blocks */
Packit 47f805
int CDECL lame_set_force_short_blocks(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_force_short_blocks(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* Input PCM is emphased PCM (for instance from one of the rarely
Packit 47f805
   emphased CDs), it is STRONGLY not recommended to use this, because
Packit 47f805
   psycho does not take it into account, and last but not least many decoders
Packit 47f805
   ignore these bits */
Packit 47f805
int CDECL lame_set_emphasis(lame_global_flags *, int);
Packit 47f805
int CDECL lame_get_emphasis(const lame_global_flags *);
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/************************************************************************/
Packit 47f805
/* internal variables, cannot be set...                                 */
Packit 47f805
/* provided because they may be of use to calling application           */
Packit 47f805
/************************************************************************/
Packit 47f805
/* version  0=MPEG-2  1=MPEG-1  (2=MPEG-2.5)     */
Packit 47f805
int CDECL lame_get_version(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* encoder delay   */
Packit 47f805
int CDECL lame_get_encoder_delay(const lame_global_flags *);
Packit 47f805
Packit 47f805
/*
Packit 47f805
  padding appended to the input to make sure decoder can fully decode
Packit 47f805
  all input.  Note that this value can only be calculated during the
Packit 47f805
  call to lame_encoder_flush().  Before lame_encoder_flush() has
Packit 47f805
  been called, the value of encoder_padding = 0.
Packit 47f805
*/
Packit 47f805
int CDECL lame_get_encoder_padding(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* size of MPEG frame */
Packit 47f805
int CDECL lame_get_framesize(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* number of PCM samples buffered, but not yet encoded to mp3 data. */
Packit 47f805
int CDECL lame_get_mf_samples_to_encode( const lame_global_flags*  gfp );
Packit 47f805
Packit 47f805
/*
Packit 47f805
  size (bytes) of mp3 data buffered, but not yet encoded.
Packit 47f805
  this is the number of bytes which would be output by a call to
Packit 47f805
  lame_encode_flush_nogap.  NOTE: lame_encode_flush() will return
Packit 47f805
  more bytes than this because it will encode the reamining buffered
Packit 47f805
  PCM samples before flushing the mp3 buffers.
Packit 47f805
*/
Packit 47f805
int CDECL lame_get_size_mp3buffer( const lame_global_flags*  gfp );
Packit 47f805
Packit 47f805
/* number of frames encoded so far */
Packit 47f805
int CDECL lame_get_frameNum(const lame_global_flags *);
Packit 47f805
Packit 47f805
/*
Packit 47f805
  lame's estimate of the total number of frames to be encoded
Packit 47f805
   only valid if calling program set num_samples
Packit 47f805
*/
Packit 47f805
int CDECL lame_get_totalframes(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* RadioGain value. Multiplied by 10 and rounded to the nearest. */
Packit 47f805
int CDECL lame_get_RadioGain(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* AudiophileGain value. Multipled by 10 and rounded to the nearest. */
Packit 47f805
int CDECL lame_get_AudiophileGain(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* the peak sample */
Packit 47f805
float CDECL lame_get_PeakSample(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* Gain change required for preventing clipping. The value is correct only if
Packit 47f805
   peak sample searching was enabled. If negative then the waveform
Packit 47f805
   already does not clip. The value is multiplied by 10 and rounded up. */
Packit 47f805
int CDECL lame_get_noclipGainChange(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* user-specified scale factor required for preventing clipping. Value is
Packit 47f805
   correct only if peak sample searching was enabled and no user-specified
Packit 47f805
   scaling was performed. If negative then either the waveform already does
Packit 47f805
   not clip or the value cannot be determined */
Packit 47f805
float CDECL lame_get_noclipScale(const lame_global_flags *);
Packit 47f805
Packit 47f805
/* returns the limit of PCM samples, which one can pass in an encode call
Packit 47f805
   under the constrain of a provided buffer of size buffer_size */
Packit 47f805
int CDECL lame_get_maximum_number_of_samples(lame_t gfp, size_t buffer_size);
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * REQUIRED:
Packit 47f805
 * sets more internal configuration based on data provided above.
Packit 47f805
 * returns -1 if something failed.
Packit 47f805
 */
Packit 47f805
int CDECL lame_init_params(lame_global_flags *);
Packit 47f805
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:
Packit 47f805
 * get the version number, in a string. of the form:
Packit 47f805
 * "3.63 (beta)" or just "3.63".
Packit 47f805
 */
Packit 47f805
const char*  CDECL get_lame_version       ( void );
Packit 47f805
const char*  CDECL get_lame_short_version ( void );
Packit 47f805
const char*  CDECL get_lame_very_short_version ( void );
Packit 47f805
const char*  CDECL get_psy_version        ( void );
Packit 47f805
const char*  CDECL get_lame_url           ( void );
Packit 47f805
const char*  CDECL get_lame_os_bitness    ( void );
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:
Packit 47f805
 * get the version numbers in numerical form.
Packit 47f805
 */
Packit 47f805
typedef struct {
Packit 47f805
    /* generic LAME version */
Packit 47f805
    int major;
Packit 47f805
    int minor;
Packit 47f805
    int alpha;               /* 0 if not an alpha version                  */
Packit 47f805
    int beta;                /* 0 if not a beta version                    */
Packit 47f805
Packit 47f805
    /* version of the psy model */
Packit 47f805
    int psy_major;
Packit 47f805
    int psy_minor;
Packit 47f805
    int psy_alpha;           /* 0 if not an alpha version                  */
Packit 47f805
    int psy_beta;            /* 0 if not a beta version                    */
Packit 47f805
Packit 47f805
    /* compile time features */
Packit 47f805
    const char *features;    /* Don't make assumptions about the contents! */
Packit 47f805
} lame_version_t;
Packit 47f805
void CDECL get_lame_version_numerical(lame_version_t *);
Packit 47f805
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:
Packit 47f805
 * print internal lame configuration to message handler
Packit 47f805
 */
Packit 47f805
void CDECL lame_print_config(const lame_global_flags*  gfp);
Packit 47f805
Packit 47f805
void CDECL lame_print_internals( const lame_global_flags *gfp);
Packit 47f805
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * input pcm data, output (maybe) mp3 frames.
Packit 47f805
 * This routine handles all buffering, resampling and filtering for you.
Packit 47f805
 *
Packit 47f805
 * return code     number of bytes output in mp3buf. Can be 0
Packit 47f805
 *                 -1:  mp3buf was too small
Packit 47f805
 *                 -2:  malloc() problem
Packit 47f805
 *                 -3:  lame_init_params() not called
Packit 47f805
 *                 -4:  psycho acoustic problems
Packit 47f805
 *
Packit 47f805
 * The required mp3buf_size can be computed from num_samples,
Packit 47f805
 * samplerate and encoding rate, but here is a worst case estimate:
Packit 47f805
 *
Packit 47f805
 * mp3buf_size in bytes = 1.25*num_samples + 7200
Packit 47f805
 *
Packit 47f805
 * I think a tighter bound could be:  (mt, March 2000)
Packit 47f805
 * MPEG1:
Packit 47f805
 *    num_samples*(bitrate/8)/samplerate + 4*1152*(bitrate/8)/samplerate + 512
Packit 47f805
 * MPEG2:
Packit 47f805
 *    num_samples*(bitrate/8)/samplerate + 4*576*(bitrate/8)/samplerate + 256
Packit 47f805
 *
Packit 47f805
 * but test first if you use that!
Packit 47f805
 *
Packit 47f805
 * set mp3buf_size = 0 and LAME will not check if mp3buf_size is
Packit 47f805
 * large enough.
Packit 47f805
 *
Packit 47f805
 * NOTE:
Packit 47f805
 * if gfp->num_channels=2, but gfp->mode = 3 (mono), the L & R channels
Packit 47f805
 * will be averaged into the L channel before encoding only the L channel
Packit 47f805
 * This will overwrite the data in buffer_l[] and buffer_r[].
Packit 47f805
 *
Packit 47f805
*/
Packit 47f805
int CDECL lame_encode_buffer (
Packit 47f805
        lame_global_flags*  gfp,           /* global context handle         */
Packit 47f805
        const short int     buffer_l [],   /* PCM data for left channel     */
Packit 47f805
        const short int     buffer_r [],   /* PCM data for right channel    */
Packit 47f805
        const int           nsamples,      /* number of samples per channel */
Packit 47f805
        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */
Packit 47f805
        const int           mp3buf_size ); /* number of valid octets in this
Packit 47f805
                                              stream                        */
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * as above, but input has L & R channel data interleaved.
Packit 47f805
 * NOTE:
Packit 47f805
 * num_samples = number of samples in the L (or R)
Packit 47f805
 * channel, not the total number of samples in pcm[]
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_buffer_interleaved(
Packit 47f805
        lame_global_flags*  gfp,           /* global context handlei        */
Packit 47f805
        short int           pcm[],         /* PCM data for left and right
Packit 47f805
                                              channel, interleaved          */
Packit 47f805
        int                 num_samples,   /* number of samples per channel,
Packit 47f805
                                              _not_ number of samples in
Packit 47f805
                                              pcm[]                         */
Packit 47f805
        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */
Packit 47f805
        int                 mp3buf_size ); /* number of valid octets in this
Packit 47f805
                                              stream                        */
Packit 47f805
Packit 47f805
Packit 47f805
/* as lame_encode_buffer, but for 'float's.
Packit 47f805
 * !! NOTE: !! data must still be scaled to be in the same range as
Packit 47f805
 * short int, +/- 32768
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_buffer_float(
Packit 47f805
        lame_global_flags*  gfp,           /* global context handle         */
Packit 47f805
        const float         pcm_l [],      /* PCM data for left channel     */
Packit 47f805
        const float         pcm_r [],      /* PCM data for right channel    */
Packit 47f805
        const int           nsamples,      /* number of samples per channel */
Packit 47f805
        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */
Packit 47f805
        const int           mp3buf_size ); /* number of valid octets in this
Packit 47f805
                                              stream                        */
Packit 47f805
Packit 47f805
/* as lame_encode_buffer, but for 'float's.
Packit 47f805
 * !! NOTE: !! data must be scaled to +/- 1 full scale
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_buffer_ieee_float(
Packit 47f805
        lame_t          gfp,
Packit 47f805
        const float     pcm_l [],          /* PCM data for left channel     */
Packit 47f805
        const float     pcm_r [],          /* PCM data for right channel    */
Packit 47f805
        const int       nsamples,
Packit 47f805
        unsigned char * mp3buf,
Packit 47f805
        const int       mp3buf_size);
Packit 47f805
int CDECL lame_encode_buffer_interleaved_ieee_float(
Packit 47f805
        lame_t          gfp,
Packit 47f805
        const float     pcm[],             /* PCM data for left and right
Packit 47f805
                                              channel, interleaved          */
Packit 47f805
        const int       nsamples,
Packit 47f805
        unsigned char * mp3buf,
Packit 47f805
        const int       mp3buf_size);
Packit 47f805
Packit 47f805
/* as lame_encode_buffer, but for 'double's.
Packit 47f805
 * !! NOTE: !! data must be scaled to +/- 1 full scale
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_buffer_ieee_double(
Packit 47f805
        lame_t          gfp,
Packit 47f805
        const double    pcm_l [],          /* PCM data for left channel     */
Packit 47f805
        const double    pcm_r [],          /* PCM data for right channel    */
Packit 47f805
        const int       nsamples,
Packit 47f805
        unsigned char * mp3buf,
Packit 47f805
        const int       mp3buf_size);
Packit 47f805
int CDECL lame_encode_buffer_interleaved_ieee_double(
Packit 47f805
        lame_t          gfp,
Packit 47f805
        const double    pcm[],             /* PCM data for left and right
Packit 47f805
                                              channel, interleaved          */
Packit 47f805
        const int       nsamples,
Packit 47f805
        unsigned char * mp3buf,
Packit 47f805
        const int       mp3buf_size);
Packit 47f805
Packit 47f805
/* as lame_encode_buffer, but for long's
Packit 47f805
 * !! NOTE: !! data must still be scaled to be in the same range as
Packit 47f805
 * short int, +/- 32768
Packit 47f805
 *
Packit 47f805
 * This scaling was a mistake (doesn't allow one to exploit full
Packit 47f805
 * precision of type 'long'.  Use lame_encode_buffer_long2() instead.
Packit 47f805
 *
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_buffer_long(
Packit 47f805
        lame_global_flags*  gfp,           /* global context handle         */
Packit 47f805
        const long     buffer_l [],       /* PCM data for left channel     */
Packit 47f805
        const long     buffer_r [],       /* PCM data for right channel    */
Packit 47f805
        const int           nsamples,      /* number of samples per channel */
Packit 47f805
        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */
Packit 47f805
        const int           mp3buf_size ); /* number of valid octets in this
Packit 47f805
                                              stream                        */
Packit 47f805
Packit 47f805
/* Same as lame_encode_buffer_long(), but with correct scaling.
Packit 47f805
 * !! NOTE: !! data must still be scaled to be in the same range as
Packit 47f805
 * type 'long'.   Data should be in the range:  +/- 2^(8*size(long)-1)
Packit 47f805
 *
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_buffer_long2(
Packit 47f805
        lame_global_flags*  gfp,           /* global context handle         */
Packit 47f805
        const long     buffer_l [],       /* PCM data for left channel     */
Packit 47f805
        const long     buffer_r [],       /* PCM data for right channel    */
Packit 47f805
        const int           nsamples,      /* number of samples per channel */
Packit 47f805
        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */
Packit 47f805
        const int           mp3buf_size ); /* number of valid octets in this
Packit 47f805
                                              stream                        */
Packit 47f805
Packit 47f805
/* as lame_encode_buffer, but for int's
Packit 47f805
 * !! NOTE: !! input should be scaled to the maximum range of 'int'
Packit 47f805
 * If int is 4 bytes, then the values should range from
Packit 47f805
 * +/- 2147483648.
Packit 47f805
 *
Packit 47f805
 * This routine does not (and cannot, without loosing precision) use
Packit 47f805
 * the same scaling as the rest of the lame_encode_buffer() routines.
Packit 47f805
 *
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_buffer_int(
Packit 47f805
        lame_global_flags*  gfp,           /* global context handle         */
Packit 47f805
        const int      buffer_l [],       /* PCM data for left channel     */
Packit 47f805
        const int      buffer_r [],       /* PCM data for right channel    */
Packit 47f805
        const int           nsamples,      /* number of samples per channel */
Packit 47f805
        unsigned char*      mp3buf,        /* pointer to encoded MP3 stream */
Packit 47f805
        const int           mp3buf_size ); /* number of valid octets in this
Packit 47f805
                                              stream                        */
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * as above, but for interleaved data.
Packit 47f805
 * !! NOTE: !! data must still be scaled to be in the same range as
Packit 47f805
 * type 'int32_t'.   Data should be in the range:  +/- 2^(8*size(int32_t)-1)
Packit 47f805
 * NOTE:
Packit 47f805
 * num_samples = number of samples in the L (or R)
Packit 47f805
 * channel, not the total number of samples in pcm[]
Packit 47f805
 */
Packit 47f805
int
Packit 47f805
lame_encode_buffer_interleaved_int(
Packit 47f805
        lame_t          gfp,
Packit 47f805
        const int       pcm [],            /* PCM data for left and right
Packit 47f805
                                              channel, interleaved          */
Packit 47f805
        const int       nsamples,          /* number of samples per channel,
Packit 47f805
                                              _not_ number of samples in
Packit 47f805
                                              pcm[]                         */
Packit 47f805
        unsigned char*  mp3buf,            /* pointer to encoded MP3 stream */
Packit 47f805
        const int       mp3buf_size );     /* number of valid octets in this
Packit 47f805
                                              stream                        */
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * REQUIRED:
Packit 47f805
 * lame_encode_flush will flush the intenal PCM buffers, padding with
Packit 47f805
 * 0's to make sure the final frame is complete, and then flush
Packit 47f805
 * the internal MP3 buffers, and thus may return a
Packit 47f805
 * final few mp3 frames.  'mp3buf' should be at least 7200 bytes long
Packit 47f805
 * to hold all possible emitted data.
Packit 47f805
 *
Packit 47f805
 * will also write id3v1 tags (if any) into the bitstream
Packit 47f805
 *
Packit 47f805
 * return code = number of bytes output to mp3buf. Can be 0
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_flush(
Packit 47f805
        lame_global_flags *  gfp,    /* global context handle                 */
Packit 47f805
        unsigned char*       mp3buf, /* pointer to encoded MP3 stream         */
Packit 47f805
        int                  size);  /* number of valid octets in this stream */
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:
Packit 47f805
 * lame_encode_flush_nogap will flush the internal mp3 buffers and pad
Packit 47f805
 * the last frame with ancillary data so it is a complete mp3 frame.
Packit 47f805
 *
Packit 47f805
 * 'mp3buf' should be at least 7200 bytes long
Packit 47f805
 * to hold all possible emitted data.
Packit 47f805
 *
Packit 47f805
 * After a call to this routine, the outputed mp3 data is complete, but
Packit 47f805
 * you may continue to encode new PCM samples and write future mp3 data
Packit 47f805
 * to a different file.  The two mp3 files will play back with no gaps
Packit 47f805
 * if they are concatenated together.
Packit 47f805
 *
Packit 47f805
 * This routine will NOT write id3v1 tags into the bitstream.
Packit 47f805
 *
Packit 47f805
 * return code = number of bytes output to mp3buf. Can be 0
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_flush_nogap(
Packit 47f805
        lame_global_flags *  gfp,    /* global context handle                 */
Packit 47f805
        unsigned char*       mp3buf, /* pointer to encoded MP3 stream         */
Packit 47f805
        int                  size);  /* number of valid octets in this stream */
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:
Packit 47f805
 * Normally, this is called by lame_init_params().  It writes id3v2 and
Packit 47f805
 * Xing headers into the front of the bitstream, and sets frame counters
Packit 47f805
 * and bitrate histogram data to 0.  You can also call this after
Packit 47f805
 * lame_encode_flush_nogap().
Packit 47f805
 */
Packit 47f805
int CDECL lame_init_bitstream(
Packit 47f805
        lame_global_flags *  gfp);    /* global context handle                 */
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:    some simple statistics
Packit 47f805
 * a bitrate histogram to visualize the distribution of used frame sizes
Packit 47f805
 * a stereo mode histogram to visualize the distribution of used stereo
Packit 47f805
 *   modes, useful in joint-stereo mode only
Packit 47f805
 *   0: LR    left-right encoded
Packit 47f805
 *   1: LR-I  left-right and intensity encoded (currently not supported)
Packit 47f805
 *   2: MS    mid-side encoded
Packit 47f805
 *   3: MS-I  mid-side and intensity encoded (currently not supported)
Packit 47f805
 *
Packit 47f805
 * attention: don't call them after lame_encode_finish
Packit 47f805
 * suggested: lame_encode_flush -> lame_*_hist -> lame_close
Packit 47f805
 */
Packit 47f805
Packit 47f805
void CDECL lame_bitrate_hist(
Packit 47f805
        const lame_global_flags * gfp,
Packit 47f805
        int bitrate_count[14] );
Packit 47f805
void CDECL lame_bitrate_kbps(
Packit 47f805
        const lame_global_flags * gfp,
Packit 47f805
        int bitrate_kbps [14] );
Packit 47f805
void CDECL lame_stereo_mode_hist(
Packit 47f805
        const lame_global_flags * gfp,
Packit 47f805
        int stereo_mode_count[4] );
Packit 47f805
Packit 47f805
void CDECL lame_bitrate_stereo_mode_hist (
Packit 47f805
        const lame_global_flags * gfp,
Packit 47f805
        int bitrate_stmode_count[14][4] );
Packit 47f805
Packit 47f805
void CDECL lame_block_type_hist (
Packit 47f805
        const lame_global_flags * gfp,
Packit 47f805
        int btype_count[6] );
Packit 47f805
Packit 47f805
void CDECL lame_bitrate_block_type_hist (
Packit 47f805
        const lame_global_flags * gfp,
Packit 47f805
        int bitrate_btype_count[14][6] );
Packit 47f805
Packit 47f805
#if (DEPRECATED_OR_OBSOLETE_CODE_REMOVED && 0)
Packit 47f805
#else
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:
Packit 47f805
 * lame_mp3_tags_fid will rewrite a Xing VBR tag to the mp3 file with file
Packit 47f805
 * pointer fid.  These calls perform forward and backwards seeks, so make
Packit 47f805
 * sure fid is a real file.  Make sure lame_encode_flush has been called,
Packit 47f805
 * and all mp3 data has been written to the file before calling this
Packit 47f805
 * function.
Packit 47f805
 * NOTE:
Packit 47f805
 * if VBR  tags are turned off by the user, or turned off by LAME because
Packit 47f805
 * the output is not a regular file, this call does nothing
Packit 47f805
 * NOTE:
Packit 47f805
 * LAME wants to read from the file to skip an optional ID3v2 tag, so
Packit 47f805
 * make sure you opened the file for writing and reading.
Packit 47f805
 * NOTE:
Packit 47f805
 * You can call lame_get_lametag_frame instead, if you want to insert
Packit 47f805
 * the lametag yourself.
Packit 47f805
*/
Packit 47f805
void CDECL lame_mp3_tags_fid(lame_global_flags *, FILE* fid);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * OPTIONAL:
Packit 47f805
 * lame_get_lametag_frame copies the final LAME-tag into 'buffer'.
Packit 47f805
 * The function returns the number of bytes copied into buffer, or
Packit 47f805
 * the required buffer size, if the provided buffer is too small.
Packit 47f805
 * Function failed, if the return value is larger than 'size'!
Packit 47f805
 * Make sure lame_encode flush has been called before calling this function.
Packit 47f805
 * NOTE:
Packit 47f805
 * if VBR  tags are turned off by the user, or turned off by LAME,
Packit 47f805
 * this call does nothing and returns 0.
Packit 47f805
 * NOTE:
Packit 47f805
 * LAME inserted an empty frame in the beginning of mp3 audio data,
Packit 47f805
 * which you have to replace by the final LAME-tag frame after encoding.
Packit 47f805
 * In case there is no ID3v2 tag, usually this frame will be the very first
Packit 47f805
 * data in your mp3 file. If you put some other leading data into your
Packit 47f805
 * file, you'll have to do some bookkeeping about where to write this buffer.
Packit 47f805
 */
Packit 47f805
size_t CDECL lame_get_lametag_frame(
Packit 47f805
        const lame_global_flags *, unsigned char* buffer, size_t size);
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * REQUIRED:
Packit 47f805
 * final call to free all remaining buffers
Packit 47f805
 */
Packit 47f805
int  CDECL lame_close (lame_global_flags *);
Packit 47f805
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
/*
Packit 47f805
 * OBSOLETE:
Packit 47f805
 * lame_encode_finish combines lame_encode_flush() and lame_close() in
Packit 47f805
 * one call.  However, once this call is made, the statistics routines
Packit 47f805
 * will no longer work because the data will have been cleared, and
Packit 47f805
 * lame_mp3_tags_fid() cannot be called to add data to the VBR header
Packit 47f805
 */
Packit 47f805
int CDECL lame_encode_finish(
Packit 47f805
        lame_global_flags*  gfp,
Packit 47f805
        unsigned char*      mp3buf,
Packit 47f805
        int                 size );
Packit 47f805
#endif
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/*********************************************************************
Packit 47f805
 *
Packit 47f805
 * decoding
Packit 47f805
 *
Packit 47f805
 * a simple interface to mpglib, part of mpg123, is also included if
Packit 47f805
 * libmp3lame is compiled with HAVE_MPGLIB
Packit 47f805
 *
Packit 47f805
 *********************************************************************/
Packit 47f805
Packit 47f805
struct hip_global_struct;
Packit 47f805
typedef struct hip_global_struct hip_global_flags;
Packit 47f805
typedef hip_global_flags *hip_t;
Packit 47f805
Packit 47f805
Packit 47f805
typedef struct {
Packit 47f805
  int header_parsed;   /* 1 if header was parsed and following data was
Packit 47f805
                          computed                                       */
Packit 47f805
  int stereo;          /* number of channels                             */
Packit 47f805
  int samplerate;      /* sample rate                                    */
Packit 47f805
  int bitrate;         /* bitrate                                        */
Packit 47f805
  int mode;            /* mp3 frame type                                 */
Packit 47f805
  int mode_ext;        /* mp3 frame type                                 */
Packit 47f805
  int framesize;       /* number of samples per mp3 frame                */
Packit 47f805
Packit 47f805
  /* this data is only computed if mpglib detects a Xing VBR header */
Packit 47f805
  unsigned long nsamp; /* number of samples in mp3 file.                 */
Packit 47f805
  int totalframes;     /* total number of frames in mp3 file             */
Packit 47f805
Packit 47f805
  /* this data is not currently computed by the mpglib routines */
Packit 47f805
  int framenum;        /* frames decoded counter                         */
Packit 47f805
} mp3data_struct;
Packit 47f805
Packit 47f805
/* required call to initialize decoder */
Packit 47f805
hip_t CDECL hip_decode_init(void);
Packit 47f805
Packit 47f805
/* cleanup call to exit decoder  */
Packit 47f805
int CDECL hip_decode_exit(hip_t gfp);
Packit 47f805
Packit 47f805
/* HIP reporting functions */
Packit 47f805
void CDECL hip_set_errorf(hip_t gfp, lame_report_function f);
Packit 47f805
void CDECL hip_set_debugf(hip_t gfp, lame_report_function f);
Packit 47f805
void CDECL hip_set_msgf  (hip_t gfp, lame_report_function f);
Packit 47f805
Packit 47f805
/*********************************************************************
Packit 47f805
 * input 1 mp3 frame, output (maybe) pcm data.
Packit 47f805
 *
Packit 47f805
 *  nout = hip_decode(hip, mp3buf,len,pcm_l,pcm_r);
Packit 47f805
 *
Packit 47f805
 * input:
Packit 47f805
 *    len          :  number of bytes of mp3 data in mp3buf
Packit 47f805
 *    mp3buf[len]  :  mp3 data to be decoded
Packit 47f805
 *
Packit 47f805
 * output:
Packit 47f805
 *    nout:  -1    : decoding error
Packit 47f805
 *            0    : need more data before we can complete the decode
Packit 47f805
 *           >0    : returned 'nout' samples worth of data in pcm_l,pcm_r
Packit 47f805
 *    pcm_l[nout]  : left channel data
Packit 47f805
 *    pcm_r[nout]  : right channel data
Packit 47f805
 *
Packit 47f805
 *********************************************************************/
Packit 47f805
int CDECL hip_decode( hip_t           gfp
Packit 47f805
                    , unsigned char * mp3buf
Packit 47f805
                    , size_t          len
Packit 47f805
                    , short           pcm_l[]
Packit 47f805
                    , short           pcm_r[]
Packit 47f805
                    );
Packit 47f805
Packit 47f805
/* same as hip_decode, and also returns mp3 header data */
Packit 47f805
int CDECL hip_decode_headers( hip_t           gfp
Packit 47f805
                            , unsigned char*  mp3buf
Packit 47f805
                            , size_t          len
Packit 47f805
                            , short           pcm_l[]
Packit 47f805
                            , short           pcm_r[]
Packit 47f805
                            , mp3data_struct* mp3data
Packit 47f805
                            );
Packit 47f805
Packit 47f805
/* same as hip_decode, but returns at most one frame */
Packit 47f805
int CDECL hip_decode1( hip_t          gfp
Packit 47f805
                     , unsigned char* mp3buf
Packit 47f805
                     , size_t         len
Packit 47f805
                     , short          pcm_l[]
Packit 47f805
                     , short          pcm_r[]
Packit 47f805
                     );
Packit 47f805
Packit 47f805
/* same as hip_decode1, but returns at most one frame and mp3 header data */
Packit 47f805
int CDECL hip_decode1_headers( hip_t           gfp
Packit 47f805
                             , unsigned char*  mp3buf
Packit 47f805
                             , size_t          len
Packit 47f805
                             , short           pcm_l[]
Packit 47f805
                             , short           pcm_r[]
Packit 47f805
                             , mp3data_struct* mp3data
Packit 47f805
                             );
Packit 47f805
Packit 47f805
/* same as hip_decode1_headers, but also returns enc_delay and enc_padding
Packit 47f805
   from VBR Info tag, (-1 if no info tag was found) */
Packit 47f805
int CDECL hip_decode1_headersB( hip_t gfp
Packit 47f805
                              , unsigned char*   mp3buf
Packit 47f805
                              , size_t           len
Packit 47f805
                              , short            pcm_l[]
Packit 47f805
                              , short            pcm_r[]
Packit 47f805
                              , mp3data_struct*  mp3data
Packit 47f805
                              , int             *enc_delay
Packit 47f805
                              , int             *enc_padding
Packit 47f805
                              );
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
/* OBSOLETE:
Packit 47f805
 * lame_decode... functions are there to keep old code working
Packit 47f805
 * but it is strongly recommended to replace calls by hip_decode...
Packit 47f805
 * function calls, see above.
Packit 47f805
 */
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
int CDECL lame_decode_init(void);
Packit 47f805
int CDECL lame_decode(
Packit 47f805
        unsigned char *  mp3buf,
Packit 47f805
        int              len,
Packit 47f805
        short            pcm_l[],
Packit 47f805
        short            pcm_r[] );
Packit 47f805
int CDECL lame_decode_headers(
Packit 47f805
        unsigned char*   mp3buf,
Packit 47f805
        int              len,
Packit 47f805
        short            pcm_l[],
Packit 47f805
        short            pcm_r[],
Packit 47f805
        mp3data_struct*  mp3data );
Packit 47f805
int CDECL lame_decode1(
Packit 47f805
        unsigned char*  mp3buf,
Packit 47f805
        int             len,
Packit 47f805
        short           pcm_l[],
Packit 47f805
        short           pcm_r[] );
Packit 47f805
int CDECL lame_decode1_headers(
Packit 47f805
        unsigned char*   mp3buf,
Packit 47f805
        int              len,
Packit 47f805
        short            pcm_l[],
Packit 47f805
        short            pcm_r[],
Packit 47f805
        mp3data_struct*  mp3data );
Packit 47f805
int CDECL lame_decode1_headersB(
Packit 47f805
        unsigned char*   mp3buf,
Packit 47f805
        int              len,
Packit 47f805
        short            pcm_l[],
Packit 47f805
        short            pcm_r[],
Packit 47f805
        mp3data_struct*  mp3data,
Packit 47f805
        int              *enc_delay,
Packit 47f805
        int              *enc_padding );
Packit 47f805
int CDECL lame_decode_exit(void);
Packit 47f805
Packit 47f805
#endif /* obsolete lame_decode API calls */
Packit 47f805
Packit 47f805
Packit 47f805
/*********************************************************************
Packit 47f805
 *
Packit 47f805
 * id3tag stuff
Packit 47f805
 *
Packit 47f805
 *********************************************************************/
Packit 47f805
Packit 47f805
/*
Packit 47f805
 * id3tag.h -- Interface to write ID3 version 1 and 2 tags.
Packit 47f805
 *
Packit 47f805
 * Copyright (C) 2000 Don Melton.
Packit 47f805
 *
Packit 47f805
 * This library is free software; you can redistribute it and/or
Packit 47f805
 * modify it under the terms of the GNU Library General Public
Packit 47f805
 * License as published by the Free Software Foundation; either
Packit 47f805
 * version 2 of the License, or (at your option) any later version.
Packit 47f805
 *
Packit 47f805
 * This library is distributed in the hope that it will be useful,
Packit 47f805
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 47f805
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 47f805
 * Library General Public License for more details.
Packit 47f805
 *
Packit 47f805
 * You should have received a copy of the GNU Library General Public
Packit 47f805
 * License along with this library; if not, write to the Free Software
Packit 47f805
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Packit 47f805
 */
Packit 47f805
Packit 47f805
/* utility to obtain alphabetically sorted list of genre names with numbers */
Packit 47f805
void CDECL id3tag_genre_list(
Packit 47f805
        void (*handler)(int, const char *, void *),
Packit 47f805
        void*  cookie);
Packit 47f805
Packit 47f805
void CDECL id3tag_init     (lame_t gfp);
Packit 47f805
Packit 47f805
/* force addition of version 2 tag */
Packit 47f805
void CDECL id3tag_add_v2   (lame_t gfp);
Packit 47f805
Packit 47f805
/* add only a version 1 tag */
Packit 47f805
void CDECL id3tag_v1_only  (lame_t gfp);
Packit 47f805
Packit 47f805
/* add only a version 2 tag */
Packit 47f805
void CDECL id3tag_v2_only  (lame_t gfp);
Packit 47f805
Packit 47f805
/* pad version 1 tag with spaces instead of nulls */
Packit 47f805
void CDECL id3tag_space_v1 (lame_t gfp);
Packit 47f805
Packit 47f805
/* pad version 2 tag with extra 128 bytes */
Packit 47f805
void CDECL id3tag_pad_v2   (lame_t gfp);
Packit 47f805
Packit 47f805
/* pad version 2 tag with extra n bytes */
Packit 47f805
void CDECL id3tag_set_pad  (lame_t gfp, size_t n);
Packit 47f805
Packit 47f805
void CDECL id3tag_set_title(lame_t gfp, const char* title);
Packit 47f805
void CDECL id3tag_set_artist(lame_t gfp, const char* artist);
Packit 47f805
void CDECL id3tag_set_album(lame_t gfp, const char* album);
Packit 47f805
void CDECL id3tag_set_year(lame_t gfp, const char* year);
Packit 47f805
void CDECL id3tag_set_comment(lame_t gfp, const char* comment);
Packit 47f805
            
Packit 47f805
/* return -1 result if track number is out of ID3v1 range
Packit 47f805
                    and ignored for ID3v1 */
Packit 47f805
int CDECL id3tag_set_track(lame_t gfp, const char* track);
Packit 47f805
Packit 47f805
/* return non-zero result if genre name or number is invalid
Packit 47f805
  result 0: OK
Packit 47f805
  result -1: genre number out of range
Packit 47f805
  result -2: no valid ID3v1 genre name, mapped to ID3v1 'Other'
Packit 47f805
             but taken as-is for ID3v2 genre tag */
Packit 47f805
int CDECL id3tag_set_genre(lame_t gfp, const char* genre);
Packit 47f805
Packit 47f805
/* return non-zero result if field name is invalid */
Packit 47f805
int CDECL id3tag_set_fieldvalue(lame_t gfp, const char* fieldvalue);
Packit 47f805
Packit 47f805
/* return non-zero result if image type is invalid */
Packit 47f805
int CDECL id3tag_set_albumart(lame_t gfp, const char* image, size_t size);
Packit 47f805
Packit 47f805
/* lame_get_id3v1_tag copies ID3v1 tag into buffer.
Packit 47f805
 * Function returns number of bytes copied into buffer, or number
Packit 47f805
 * of bytes rquired if buffer 'size' is too small.
Packit 47f805
 * Function fails, if returned value is larger than 'size'.
Packit 47f805
 * NOTE:
Packit 47f805
 * This functions does nothing, if user/LAME disabled ID3v1 tag.
Packit 47f805
 */
Packit 47f805
size_t CDECL lame_get_id3v1_tag(lame_t gfp, unsigned char* buffer, size_t size);
Packit 47f805
Packit 47f805
/* lame_get_id3v2_tag copies ID3v2 tag into buffer.
Packit 47f805
 * Function returns number of bytes copied into buffer, or number
Packit 47f805
 * of bytes rquired if buffer 'size' is too small.
Packit 47f805
 * Function fails, if returned value is larger than 'size'.
Packit 47f805
 * NOTE:
Packit 47f805
 * This functions does nothing, if user/LAME disabled ID3v2 tag.
Packit 47f805
 */
Packit 47f805
size_t CDECL lame_get_id3v2_tag(lame_t gfp, unsigned char* buffer, size_t size);
Packit 47f805
Packit 47f805
/* normaly lame_init_param writes ID3v2 tags into the audio stream
Packit 47f805
 * Call lame_set_write_id3tag_automatic(gfp, 0) before lame_init_param
Packit 47f805
 * to turn off this behaviour and get ID3v2 tag with above function
Packit 47f805
 * write it yourself into your file.
Packit 47f805
 */
Packit 47f805
void CDECL lame_set_write_id3tag_automatic(lame_global_flags * gfp, int);
Packit 47f805
int CDECL lame_get_write_id3tag_automatic(lame_global_flags const* gfp);
Packit 47f805
Packit 47f805
/* experimental */
Packit 47f805
int CDECL id3tag_set_textinfo_latin1(lame_t gfp, char const *id, char const *text);
Packit 47f805
Packit 47f805
/* experimental */
Packit 47f805
int CDECL id3tag_set_comment_latin1(lame_t gfp, char const *lang, char const *desc, char const *text);
Packit 47f805
Packit 47f805
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
Packit 47f805
#else
Packit 47f805
/* experimental */
Packit 47f805
int CDECL id3tag_set_textinfo_ucs2(lame_t gfp, char const *id, unsigned short const *text);
Packit 47f805
Packit 47f805
/* experimental */
Packit 47f805
int CDECL id3tag_set_comment_ucs2(lame_t gfp, char const *lang,
Packit 47f805
                                  unsigned short const *desc, unsigned short const *text);
Packit 47f805
Packit 47f805
/* experimental */
Packit 47f805
int CDECL id3tag_set_fieldvalue_ucs2(lame_t gfp, const unsigned short *fieldvalue);
Packit 47f805
#endif
Packit 47f805
Packit 47f805
/* experimental */
Packit 47f805
int CDECL id3tag_set_fieldvalue_utf16(lame_t gfp, const unsigned short *fieldvalue);
Packit 47f805
Packit 47f805
/* experimental */
Packit 47f805
int CDECL id3tag_set_textinfo_utf16(lame_t gfp, char const *id, unsigned short const *text);
Packit 47f805
Packit 47f805
/* experimental */
Packit 47f805
int CDECL id3tag_set_comment_utf16(lame_t gfp, char const *lang, unsigned short const *desc, unsigned short const *text);
Packit 47f805
Packit 47f805
Packit 47f805
/***********************************************************************
Packit 47f805
*
Packit 47f805
*  list of valid bitrates [kbps] & sample frequencies [Hz].
Packit 47f805
*  first index: 0: MPEG-2   values  (sample frequencies 16...24 kHz)
Packit 47f805
*               1: MPEG-1   values  (sample frequencies 32...48 kHz)
Packit 47f805
*               2: MPEG-2.5 values  (sample frequencies  8...12 kHz)
Packit 47f805
***********************************************************************/
Packit 47f805
Packit 47f805
extern const int     bitrate_table    [3][16];
Packit 47f805
extern const int     samplerate_table [3][ 4];
Packit 47f805
Packit 47f805
/* access functions for use in DLL, global vars are not exported */
Packit 47f805
int CDECL lame_get_bitrate(int mpeg_version, int table_index);
Packit 47f805
int CDECL lame_get_samplerate(int mpeg_version, int table_index);
Packit 47f805
Packit 47f805
Packit 47f805
/* maximum size of albumart image (128KB), which affects LAME_MAXMP3BUFFER
Packit 47f805
   as well since lame_encode_buffer() also returns ID3v2 tag data */
Packit 47f805
#define LAME_MAXALBUMART    (128 * 1024)
Packit 47f805
Packit 47f805
/* maximum size of mp3buffer needed if you encode at most 1152 samples for
Packit 47f805
   each call to lame_encode_buffer.  see lame_encode_buffer() below  
Packit 47f805
   (LAME_MAXMP3BUFFER is now obsolete)  */
Packit 47f805
#define LAME_MAXMP3BUFFER   (16384 + LAME_MAXALBUMART)
Packit 47f805
Packit 47f805
Packit 47f805
typedef enum {
Packit 47f805
    LAME_OKAY             =   0,
Packit 47f805
    LAME_NOERROR          =   0,
Packit 47f805
    LAME_GENERICERROR     =  -1,
Packit 47f805
    LAME_NOMEM            = -10,
Packit 47f805
    LAME_BADBITRATE       = -11,
Packit 47f805
    LAME_BADSAMPFREQ      = -12,
Packit 47f805
    LAME_INTERNALERROR    = -13,
Packit 47f805
Packit 47f805
    FRONTEND_READERROR    = -80,
Packit 47f805
    FRONTEND_WRITEERROR   = -81,
Packit 47f805
    FRONTEND_FILETOOLARGE = -82
Packit 47f805
Packit 47f805
} lame_errorcodes_t;
Packit 47f805
Packit 47f805
#if defined(__cplusplus)
Packit 47f805
}
Packit 47f805
#endif
Packit 47f805
#endif /* LAME_LAME_H */
Packit 47f805