/*
* Interface to MP3 LAME encoding engine
*
* Copyright (c) 1999 Mark Taylor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* $Id: lame.h,v 1.189.2.1 2012/01/08 23:49:58 robert Exp $ */
#ifndef LAME_LAME_H
#define LAME_LAME_H
/* for size_t typedef */
#include <stddef.h>
/* for va_list typedef */
#include <stdarg.h>
/* for FILE typedef, TODO: remove when removing lame_mp3_tags_fid */
#include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef void (*lame_report_function)(const char *format, va_list ap);
#if defined(WIN32) || defined(_WIN32)
#undef CDECL
#define CDECL __cdecl
#else
#define CDECL
#endif
#define DEPRECATED_OR_OBSOLETE_CODE_REMOVED 1
typedef enum vbr_mode_e {
vbr_off=0,
vbr_mt, /* obsolete, same as vbr_mtrh */
vbr_rh,
vbr_abr,
vbr_mtrh,
vbr_max_indicator, /* Don't use this! It's used for sanity checks. */
vbr_default=vbr_mtrh /* change this to change the default VBR mode of LAME */
} vbr_mode;
/* MPEG modes */
typedef enum MPEG_mode_e {
STEREO = 0,
JOINT_STEREO,
DUAL_CHANNEL, /* LAME doesn't supports this! */
MONO,
NOT_SET,
MAX_INDICATOR /* Don't use this! It's used for sanity checks. */
} MPEG_mode;
/* Padding types */
typedef enum Padding_type_e {
PAD_NO = 0,
PAD_ALL,
PAD_ADJUST,
PAD_MAX_INDICATOR /* Don't use this! It's used for sanity checks. */
} Padding_type;
/*presets*/
typedef enum preset_mode_e {
/*values from 8 to 320 should be reserved for abr bitrates*/
/*for abr I'd suggest to directly use the targeted bitrate as a value*/
ABR_8 = 8,
ABR_320 = 320,
V9 = 410, /*Vx to match Lame and VBR_xx to match FhG*/
VBR_10 = 410,
V8 = 420,
VBR_20 = 420,
V7 = 430,
VBR_30 = 430,
V6 = 440,
VBR_40 = 440,
V5 = 450,
VBR_50 = 450,
V4 = 460,
VBR_60 = 460,
V3 = 470,
VBR_70 = 470,
V2 = 480,
VBR_80 = 480,
V1 = 490,
VBR_90 = 490,
V0 = 500,
VBR_100 = 500,
/*still there for compatibility*/
R3MIX = 1000,
STANDARD = 1001,
EXTREME = 1002,
INSANE = 1003,
STANDARD_FAST = 1004,
EXTREME_FAST = 1005,
MEDIUM = 1006,
MEDIUM_FAST = 1007
} preset_mode;
/*asm optimizations*/
typedef enum asm_optimizations_e {
MMX = 1,
AMD_3DNOW = 2,
SSE = 3
} asm_optimizations;
/* psychoacoustic model */
typedef enum Psy_model_e {
PSY_GPSYCHO = 1,
PSY_NSPSYTUNE = 2
} Psy_model;
/* buffer considerations */
typedef enum buffer_constraint_e {
MDB_DEFAULT=0,
MDB_STRICT_ISO=1,
MDB_MAXIMUM=2
} buffer_constraint;
struct lame_global_struct;
typedef struct lame_global_struct lame_global_flags;
typedef lame_global_flags *lame_t;
/***********************************************************************
*
* The LAME API
* These functions should be called, in this order, for each
* MP3 file to be encoded. See the file "API" for more documentation
*
***********************************************************************/
/*
* REQUIRED:
* initialize the encoder. sets default for all encoder parameters,
* returns NULL if some malloc()'s failed
* otherwise returns pointer to structure needed for all future
* API calls.
*/
lame_global_flags * CDECL lame_init(void);
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
#else
/* obsolete version */
int CDECL lame_init_old(lame_global_flags *);
#endif
/*
* OPTIONAL:
* set as needed to override defaults
*/
/********************************************************************
* input stream description
***********************************************************************/
/* number of samples. default = 2^32-1 */
int CDECL lame_set_num_samples(lame_global_flags *, unsigned long);
unsigned long CDECL lame_get_num_samples(const lame_global_flags *);
/* input sample rate in Hz. default = 44100hz */
int CDECL lame_set_in_samplerate(lame_global_flags *, int);
int CDECL lame_get_in_samplerate(const lame_global_flags *);
/* number of channels in input stream. default=2 */
int CDECL lame_set_num_channels(lame_global_flags *, int);
int CDECL lame_get_num_channels(const lame_global_flags *);
/*
scale the input by this amount before encoding. default=1
(not used by decoding routines)
*/
int CDECL lame_set_scale(lame_global_flags *, float);
float CDECL lame_get_scale(const lame_global_flags *);
/*
scale the channel 0 (left) input by this amount before encoding. default=1
(not used by decoding routines)
*/
int CDECL lame_set_scale_left(lame_global_flags *, float);
float CDECL lame_get_scale_left(const lame_global_flags *);
/*
scale the channel 1 (right) input by this amount before encoding. default=1
(not used by decoding routines)
*/
int CDECL lame_set_scale_right(lame_global_flags *, float);
float CDECL lame_get_scale_right(const lame_global_flags *);
/*
output sample rate in Hz. default = 0, which means LAME picks best value
based on the amount of compression. MPEG only allows:
MPEG1 32, 44.1, 48khz
MPEG2 16, 22.05, 24
MPEG2.5 8, 11.025, 12
(not used by decoding routines)
*/
int CDECL lame_set_out_samplerate(lame_global_flags *, int);
int CDECL lame_get_out_samplerate(const lame_global_flags *);
/********************************************************************
* general control parameters
***********************************************************************/
/* 1=cause LAME to collect data for an MP3 frame analyzer. default=0 */
int CDECL lame_set_analysis(lame_global_flags *, int);
int CDECL lame_get_analysis(const lame_global_flags *);
/*
1 = write a Xing VBR header frame.
default = 1
this variable must have been added by a Hungarian notation Windows programmer :-)
*/
int CDECL lame_set_bWriteVbrTag(lame_global_flags *, int);
int CDECL lame_get_bWriteVbrTag(const lame_global_flags *);
/* 1=decode only. use lame/mpglib to convert mp3/ogg to wav. default=0 */
int CDECL lame_set_decode_only(lame_global_flags *, int);
int CDECL lame_get_decode_only(const lame_global_flags *);
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
#else
/* 1=encode a Vorbis .ogg file. default=0 */
/* DEPRECATED */
int CDECL lame_set_ogg(lame_global_flags *, int);
int CDECL lame_get_ogg(const lame_global_flags *);
#endif
/*
internal algorithm selection. True quality is determined by the bitrate
but this variable will effect quality by selecting expensive or cheap algorithms.
quality=0..9. 0=best (very slow). 9=worst.
recommended: 2 near-best quality, not too slow
5 good quality, fast
7 ok quality, really fast
*/
int CDECL lame_set_quality(lame_global_flags *, int);
int CDECL lame_get_quality(const lame_global_flags *);
/*
mode = 0,1,2,3 = stereo, jstereo, dual channel (not supported), mono
default: lame picks based on compression ration and input channels
*/
int CDECL lame_set_mode(lame_global_flags *, MPEG_mode);
MPEG_mode CDECL lame_get_mode(const lame_global_flags *);
#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED
#else
/*
mode_automs. Use a M/S mode with a switching threshold based on
compression ratio
DEPRECATED
*/
int CDECL lame_set_mode_automs(lame_global_flags *, int);
int CDECL lame_get_mode_automs(const lame_global_flags *);
#endif
/*
force_ms. Force M/S for all frames. For tes
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
快速开发ios app,封装了ios开发常用的功能.zip (235个子文件)
lame.h 48KB
Reachability.h 4KB
JSBadgeView.h 4KB
PullToRefreshView.h 2KB
DFBaseTableView.h 2KB
DFBaseDataService.h 1KB
RRDevice.h 1KB
DFBaseViewController.h 1KB
DFBaseTableViewController.h 987B
PullMoreFooterView.h 876B
DFTableViewRefreshControl.h 860B
DFCommon.h 857B
MLLabel+Size.h 748B
LXActionSheet.h 666B
DFTabIndicatorView.h 660B
DFSectionIndexTabelViewController.h 647B
pinyin.h 551B
DFVideoCaptureController.h 547B
DFVideoDecoder.h 540B
DFTableViewODRefreshControl.h 520B
DFBaseStorageService.h 499B
UIButton+Corner.h 487B
MLLinkClickLabel.h 483B
UIBarButtonItem+Lite.h 461B
DFBaseResponse.h 459B
NSDictionary+JSON.h 421B
DFCommonRegisterController.h 416B
DFBaseTabBarController.h 378B
DFDevice.h 372B
AppDelegate.h 371B
DFNetwork.h 350B
DFTableViewNativeRefreshControl.h 343B
DFBaseListDataService.h 324B
DFImageHelper.h 314B
DFUserDefaultStorageService.h 312B
NSMutableDictionary+JSON.h 311B
DFToolUtil.h 300B
DFDatabaseHelper.h 300B
DFVideoPlayController.h 290B
DFTableViewMJRefreshControl.h 290B
MP3Converter.h 283B
DFTableViewMJRefreshPlainControl.h 283B
UITabBar+Badge.h 283B
DFReachabilityUtil.h 282B
DFLogoRefreshControl.h 277B
DFView.h 261B
DFSandboxHelper.h 255B
UILabel+Corner.h 247B
ViewController.h 245B
ViewController2.h 241B
DemoHttpService.h 238B
PageController.h 220B
Contents.json 585B
Contents.json 378B
lame 2.1MB
Podfile.lock 2KB
pinyin.m 24KB
DFVideoCaptureController.m 16KB
LXActionSheet.m 15KB
JSBadgeView.m 14KB
Reachability.m 10KB
RRDevice.m 10KB
PullToRefreshView.m 9KB
DFBaseViewController.m 8KB
DFBaseTableView.m 8KB
DFCommonRegisterController.m 7KB
DFSectionIndexTabelViewController.m 7KB
PullMoreFooterView.m 6KB
DFTabIndicatorView.m 5KB
DFBaseDataService.m 5KB
ViewController2.m 4KB
DFVideoDecoder.m 4KB
DFBaseTableViewController.m 4KB
DFToolUtil.m 3KB
ViewController.m 3KB
DFVideoPlayController.m 2KB
AppDelegate.m 2KB
UIBarButtonItem+Lite.m 2KB
MLLabel+Size.m 2KB
DFLogoRefreshControl.m 2KB
DFBaseTabBarController.m 2KB
MP3Converter.m 2KB
NSDictionary+JSON.m 2KB
DFBaseListDataService.m 1KB
DFTableViewNativeRefreshControl.m 1KB
DFBaseResponse.m 1KB
DFTableViewODRefreshControl.m 1KB
DFBaseStorageService.m 1KB
UITabBar+Badge.m 1KB
UIButton+Corner.m 1KB
MLLinkClickLabel.m 1KB
DFTableViewMJRefreshControl.m 1022B
PageController.m 1000B
NSMutableDictionary+JSON.m 988B
DFTableViewMJRefreshPlainControl.m 851B
DFDatabaseHelper.m 846B
DemoHttpService.m 836B
DFTableViewRefreshControl.m 833B
DFImageHelper.m 609B
DFUserDefaultStorageService.m 428B
共 235 条
- 1
- 2
- 3
资源评论
博士僧小星
- 粉丝: 1698
- 资源: 5876
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功