ºÃ¾ÃûдBLOGÁË£¬ËÍÉÏÒ»·ÝÔ´´µÄDELPHI°æMP3ÇиsplitMp3ΪÇиÊý£¬Ö§³Ö°´Ê±¼äÇиîºÍ°´´óСÇиÍû´ó¼ÒÖ§³Ö¡£
²Î¿¼VCµÄ×ÊÁϱàдµÄMP3ÇиîDELPHI°æµ¥Ôª.
unit UnitMp3DataUtil;
{
MP3 Cut Unit.
@author Jim Wu
2009-08
}
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls;
type
Mp3SplitMode = (Mp3SplitByTime, Mp3SplitByDateLength);
TMp3DataInfo = packed record
isMp3: Boolean;
bitrate: Integer;
sampleRate: Integer;
isMono: Boolean;
isVBR: Boolean;
end;
function readMp3Head(fileName: string): TMp3DataInfo;
function splitMp3(mode: Mp3SplitMode; length: Integer; fr: TFileStream; writeFileName: string; var actualLength: Integer; var actualMillisecond: Integer): integer;
const
mpegBitrateTable: array[1..2,1..3,1..14] of Integer=(
(
( 32, 64, 96,128,160,192,224,256,288,320,352,384,416,448),
( 32, 48, 56, 64, 80, 96,112,128,160,192,224,256,320,384),
( 32, 40, 48, 56, 64, 80, 96,112,128,160,192,224,256,320)
),
(
( 32, 48, 56, 64, 80, 96,112,128,144,160,176,192,224,256),
( 8, 16, 24, 32, 40, 48, 56, 64, 80, 96,112,128,144,160),
( 8, 16, 24, 32, 40, 48, 56, 64, 80, 96,112,128,144,160)
)
);
samplingRateTable: array[1..3,0..2] of Integer=(
(44100,48000,32000),
(22050,24000,16000),
(11025,12000,8000)
);
frameLengthTable: array[1..2,1..3] of Integer=(
(48000,144000,144000),
(24000, 72000, 72000)
);
samplesPerFrameTable: array[1..2,1..3] of Integer=(
( 384
½«Ô¶³Ì¿ØÖÆÓ¦ÓÃÓÚ½ÌѧÖУ¬ÒѳÉΪĿǰ¼ÆËã»ú»¯½ÌѧµÄÖØÒªÊֶΡ£Ò»¶¨ÓкܶàµÄÍø³æÏëÁ˽âÕâÖÖÍøÂç½Ìѧ·½Ê½µÄ±à³ÌÔÀí°É¡£ÔÚ´ËÎÒÃǾÍÒÔÒ»¸ö¼òµ¥µÄÔ¶³Ì¿ØÖƳÌÐò×÷ΪʾÀý£¬ËµÃ÷ÕâÖÖÍøÂç±à³ÌµÄ»ù±¾ÔÀí¡£±¾³ÌÐòÒÔDelphi±à³ÌΪÀý¡£
¡¡¡¡Æäʵ¸Ã³ÌÐòµÄ¹¤×÷»úÖÆºÜ¼òµ¥£¬Êܿط½ÔËÐÐÒ»¸ö³ÌÐò£¬ÓÃÓÚÕìÌý¶Ë¿Ú²¢½ÓÊÕÊý¾Ý°ü£¬¶øÖ÷¿Ø·½Í¨¹ý¶ ......
Delphi 7Ö®ºóµÄ°æ±¾£¬Ôö¼ÓÁËÔËËã·ûµÄÖØÔØ¡£ËäÈ»²»¾¡ÈËÒ⣨ÐèÒªÐ´ÌØ¶¨Ó¢ÎÄ£©£¬µ«ÓÐ×ܱÈûÓÐÇ¿¡£
Àý£º
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
T3DPoint = record
X, Y, Z: Doub ......