⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bladedll.pas

📁 mp3编解码源程序
💻 PAS
字号:
unit bladedll;(*    Bladedll.h    +++++++++++++++++++++++++++    +   Blade's Encoder DLL   +    +++++++++++++++++++++++++++    ------------------------------------------------------    - Version 1.00 (7 November 1998) - Jukka Poikolainen -    ------------------------------------------------------    Initial version    ------------------------------------------------------    - Version x.xx (x xxxxxxxx xxxx) - xxxxx xxxxxxxxxxx -    ------------------------------------------------------    Delphi Version (D3 and D4).    Jack Kallestrup (jack.kallestrup@vip.cybercity.dk)    thanks to Leif Lundberg for helping with the calling convension.    Changes :    Calling convention changed from stdcall to cdecl.    Added TFormat record*)interfaceuses windows;  //type definitionsconst  // encoding formats  BE_CONFIG_MP3 = 0;  BE_CONFIG_ACC = 1;type  // type definitions  THBeStream = ULONG;  PHBeStream = ^THBEStream;  TBeErr      = ULONG;  PSHORT      = ^SHORT;  PBYTE       = ^Byte;// error codesconst  BE_ERR_SUCCESSFUL    		   =	$00000000;  BE_ERR_INVALID_FORMAT		   =	$00000001;  BE_ERR_INVALID_FORMAT_PARAMETERS =	$00000002;  BE_ERR_NO_MORE_HANDLES	   =	$00000003;  BE_ERR_INVALID_HANDLE		   =	400000004;// other constants  BE_MAX_HOMEPAGE		   =	256;// format specific variables  BE_MP3_MODE_STEREO	           =	0;  BE_MP3_MODE_DUALCHANNEL          =	2;  BE_MP3_MODE_MONO	           =	3;type  PMP3 = ^TMP3;  TMP3 = packed record    dwSampleRate : DWORD;  // 48000, 44100 and 32000 allowed    byMode       : Byte;   // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO    wBitrate     : Word;   // 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320 allowed    bPrivate,    bCRC,    bCopyright,    bOriginal    : Boolean;  end;  PAAC = ^TAAC;  TAAC = packed record    dwSampleRate : DWORD;    byMode : Byte;    wBitrate : Word;    byEncodingMethod : Byte;  end;  PFormat = ^TFormat;  TFormat = packed record    case dwConfig : DWord of // BE_CONFIG_XXXXX      BE_CONFIG_MP3 : (mp3 : TMp3);      BE_CONFIG_ACC : (acc : TAac);  end;  PBEConfig = ^TBEConfig;  TBEConfig = packed record    Format   : TFormat; // Currently only BE_CONFIG_MP3 is supported  end;  PBEVersion = ^TBEVersion;  TBEVersion = packed record    // BladeEnc DLL Version number    byDLLMajorVersion,    byDLLMinorVersion,    // BladeEnc Engine Version Number    byMajorVersion,    byMinorVersion,    // DLL Release date    byDay,    byMonth : Byte;    wYear : Word;    // BladeEnc	Homepage URL    zHomepage : Array[0..BE_MAX_HOMEPAGE] of char;  end;  function beInitStream(var pbeConfig : TBEConfig; var dwSamples : DWORD; var dwBufferSize : DWORD; var phbeStream : THBESTREAM) : TBeErr; cdecl; external 'BLADEENC.DLL';  (*    pbeConfig    = Type of mp3    dwSamples    = Maximum number of samples to encode    dwBufferSize = Maximum mp3 buffer size    hbeStream    = BladeEnc-stream  *)  function beEncodeChunk(hbeStream : THBEStream; nSamples : DWORD; pSamples : PShort;  pOutput : PByte; var pdwOutput : DWORD) : TBeErr; cdecl; external 'BLADEENC.DLL';  (*    hbeStream    =    nSamples     = Number of samples to encode    pSamples	 = Pointer to buffer with Samples to encode    pOutput	 = Pointer to buffer to recieve encoded samples    pdwOutput	 = number of samples encoded  *)  function beDeinitStream(hbeStream : THBEStream;  pOutput : PByte; var pdwOutput : DWORD) : TBeErr; cdecl; external 'BLADEENC.DLL';  (*    hbeStream    =    pOutput	 = Pointer to buffer holding encoded samples    pdwOutput	 = Number of samples to write  *)  function beCloseStream(hbeStream : THBEStream) : TBeErr; cdecl; external 'BLADEENC.DLL';  procedure beVersion(var pbeVersion : TBEVersion); cdecl; external 'BLADEENC.DLL';implementationend.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -