_____mp3SpecX4.dll_____

Help File

Contents

 

Introduction

The ActiveX DLL Component, mp3SpecX4.dll, Is A Programming Object You Can Use In Your Visual Basic 6.0 Projects... Its Work Engine Is The SpecX4 Class Object...It Scans An MPEG Audio (vs.1, vs.2, Layer I, II, III, ... mp1, .mp2, .mp3) File Looking For Frame Headers...It Identifies The File Type And Returns Its Specifications Or Properties...It Can ID Both Fixed And Variable Or Average Bitrate Files And Return Their Properties. ... It Is A Relatively Simple Object To Use, With, Only, Three Methods, Ten Standard Properties, And Six, Optional, Advanced Configuration Properties.

mp3SpecX4 Can Be Very Useful For Reading MPEG Audio File Properties Directly From Files On The Drive, Without Interrupting Your Player.. Its Sole Purpose Is To Read MPEG Audio Files And To Return Their Properties Or Specifications.

Please Note: mp3SpecX4's Function Is Not ID3 Tag Related, But MPEG Audio File Encoding - Decoding Specifications Or Properties .... The Version, Layer, BitRate, Frequency, Channel Mode, Protection, Copyright, And Original Properties, Determined By Reading The Actual Frame Headers Of The Encoded Audio Data In The File. ..The Accurate, Calculated PlayTime For The File Is, Also, Returned.

Changes In mp3SpecX4.dll From Its Predecessor, MP3SpecsX.dll:

1. Added, So Called, "Xing" Variable Bitrate Header Detection And Translation To FastScan Function. (Programmer Optional)

2. Reads vs.1, vs.2, And layer I, II, And III (originally was only vs.1, layer III)

3. Will Return A Programmer Determined Length String Beginning At Audio Frame 1, Byte1, Primarily For Use With MD5 Functions. (see aaMD5.dll Topic Below)

 

Installation (See "Installation Files" Below)

Before You Can Use mp3SpecX4.dll In Your Visual Basic 6.0 Projects Or In The Demonstration Project, You Must Run The Installation Program To Install The mp3SpecX4.dll In Your Computer...You Can Use The Windows Control Panel...Add Remove Programs Method Or Just Run The ..Setup.exe...Which Came In Your .ZIP Package.. ..Control Panel Can Also Be Used To Cleanly, And Completely, Un-Install, If You Ever Decide To Un-Install.

In Order For The Test Poject's MD5 Functions To Work In The Visual Basic IDE, Design-Time, Run Environment, You Must, Manually, Copy ...aaMD532.dll... From: C:\Program Files\mp3SpecX4\ ...To: .Vb98 Directory.

Back Up.

 

Using mp3SpecX4 In A Visual Basic 6.0 Project

A Demonstration Project Which Uses mp3SpecX4.dll In A Visual Basic 6.0 Project Is Included In Your Installation Package...It Will Be Located In The Installation Directory, (Default = C:\Program Files\mp3SpecX4\ ) ... Test_mp3SpecX4.vbp.... There Is, Also, An Extremely Simple Example Project, Shown Below.

After Installation, Open The Demonstration Project In Your Visual Basic 6.0 IDE. .Make Sure That A Reference To mp3SpecX4 ActiveX DLL Has Been Made In The Project.

To Do This Click -Project- On Your Visual Basic IDE's Menu Bar, Then Click -References-... When The Dialog Box Appears, The Checkbox Next To mp3SpecX4 ActiveX DLL Should Be Checked... Then Click -Okay-... If Not On The List In The Dialog Box When It Appeared, Click The -Browse- Button On The Dialog Box... Then Find mp3SpecX4.dll, Which Should Be Located In Its Installed Directory. Add It To The List....Then Repeat The Above Procedure To Add It As A Reference In Your Project.

If mp3SpecX4.dll Is Installed Correctly, And Added As A Reference In Your Project, It Should Appear In The Object Browser In Your Visual Basic IDE... If You Like, On The Menu Bar You Can Click -View-, Then Click -Object Browser-... When The Browser Comes Up, Select mp3SpecX4 In The -Project/Library- ComboBox In The Upper Left Corner... Then SpecX4 Class Should Appear In The Classes List....Click SpecX4 And Its Properties And Methods Will Appear In The Members List In The Object Browser Window.

To Use The SpecX4 Class Object In A Form In Your Visual Basic Project, Declare A Variable As SpecX4, .. For Example, Private MySpecX As SpecX4 ....In The Form's General Declarations Section... MySpecX Is The Object Variable Name You Create, And SpecX4 Is The Class Object Supplied By mp3SpecX4.dll... [This Has Already Been Done In The Demonstration Project]... You Should Be Able To Type MySpecX And Then A Period(.) And Have A Little Code Completion Selector Box Pop Up, If Your IDE Has This Feature Enabled, The Same As When You Type A Standard Object's Name Followed By A Period(.).

To Use The SpecX4 Methods And Properties Statements In Any Of The Form's Events Subs, You Must Load The Object Variable Which You Created In General Declarations With A "Set" Statement... For Example, ....Set MySpecX = New SpecX4.... The Set Statement Goes In The Event Sub Where You Will Use The Methods And Properties... [This Has Already Been Done In The Demonstration Project In Private Sub Command1_Click() And Private Sub Command2_Click()]

You Can Use The SpecX4 Methods And Properties Like You Would Use Any Standard Visual Basic Object's Methods And Properties...This Very Simple Example Uses SpecX4's FastScan Method To Scan A File And Put One Of Its Properties In A TextBox...

1. Install mp3SpecX4.dll

2. Open Visual Basic 6.0 IDE And Select A New, Standard .Exe Project Type.

3. Set A Reference To mp3SpecX4 ActiveX DLL In The Project References Dialoge Box..

4. Put A Command Button And A Text Box On Form1.

5. Copy In The Code Blocks From Below.. Be Sure To Change DaFile$ Equal To An Existing Path And File On Your Drive.

6. Then Press F5 To Run..

________________________________________________________________________

' ' ' General Declarations

' ' ' Declare An Object Variable As SpecX4 Class

Private MySpecX As SpecX4

_________________________________________________________________________

' ' ' ' ' Private Sub Command1_Click()

' ' ' ' 'Load The Object Variable With A New Instance Of The SpecX4 Class Object

Set MySpecX = New SpecX4

DaFile$ = "C:\Program Files\Napster\Music\DigitalAssasins - Lock It Down.mp3"

MySpecX.FastScan DaFile$' ' ' ' ' ' ' ' ' ' ' ' ' 'Use The FastScan Method To Scan DaFile$

Text1.Text = MySpecX.BitRate ' ' ' Put One Of The Properties Returned In A TextBox

Set MySpecX = Nothing ' ' ' ' ' ' Destroy Instance Of SpecX4 To Free Memory Resources

' ' ' ' End Sub

_________________________________________________________________________

Back Up.

 

SpecX4 Methods And Properties

Methods

Syntax: .. ReturnVal$ = ObjVar.GetFrame1String (FullPathFilename$, Length&)

Important Note: .. When Using Any Of The Three Methods, If You Specify A Path Which Exists, But A Non-Existant Filename, SpecX4 Will Create A Zero-Byte File With That Filename... It Is Not Checked In Order To Enhance Speed.. .So, If You Are Not Sure, Check Paths And Filenames With A Routine Before You Use Them..(See File_Exists Function In The Sample Project).. Theory: .. It Is Better To Check This With Your Code, If It Is Needed, Than To Check It In The mp3SpecX4.dll, Even When It Is Not Needed.

Properties

Generally, SpecX4 Reads MPEG Audio Frame Headers, And Returns Values For MPEG Vs.1, Vs.2 Layer I, II, & III Files... If It Reads Any Other Type Of File, It Will Return "". Null Strings For Properties.

_____( 10 - Standard Read-Only Properties)_____( Return The MPEG Specs, Or Properties, Of The File Last Scanned Using The FastScan Or The FullScan Methods)

Syntax Is The Same For All 10 Of The Standard Read Only Properties And Is:

ReturnVal$ = ObjVar.PropertyName

The Nine MPEG File Properties All Return (Null), If The File Is Not MPEG vs.1, or vs.2 , Layer I, II, Or III.

____________________________________________________________________________________________________

____________________________________________________________________________________________________

____________________________________________________________________________________________________

____________________________________________________________________________________________________

____________________________________________________________________________________________________

Returns "VAR", In A FastScan If The File Is An Average Or Variable Bitrate File Without An "Xing" Header.

____________________________________________________________________________________________________

____________________________________________________________________________________________________

____________________________________________________________________________________________________

____________________________________________________________________________________________________

Returns (Null), If No Scan Has Been Performed, Or If File Is Not mp3.

____________________________________________________________________________________________________

Returns (Null), In A FastScan If The File Is An Average Or Variable Bitrate File Without An "Xing" Header.

____________________________________________________________________________________________________

Mp3 Properties Which Are Not Returned By mp3SpecX4.dll, Becasue They Are Not Consistent Throughout A File, Have No Meaning, Or Are Rarely Ever Used, Are The Padding, Private, Mode Extension, And Emphasis Properties.

__________________________________________________________________________________________________

_____( 6 - Advanced, Read/Write, Configuration Properties)_____

The Following Six Properties Are Automatically Set To Their Default Values Whenever An Instance Of The SpecX4 Class Is Initialized...These Default Values Have Been Optimized For Most Scanning Purposes, And If You Like, You Can Ignore Them, Altogrther.

However, If You Study The Configuration Properties And Do Some Testing, You Can Set Them, And Change The Way That mp3SpecX4.dll Scans Files, And Posibly Fine Tune Its Functions For Specific Purposes. .. .A Basic Knowledge Of The Structure Of MPEG Files Would Be Helpful.

Syntax Is Similar For All 6 Of The Standard Read Only Properties. The Only Difference Is The Type Of Number, 16 bit Integer, 32bit Long, or 16 bit Boolean Integer.

Read Syntax: .. ReturnVal-IntegerType = ObjVar.PropertyName

Write Syntax: .. ObjVar.PropertyName = Val-IntegerType

____________________________________________________________________________________________________

Minimum = 0 ... Default = 10000 .... Maximum = 32000 ...(Will Auto-Reset To Default If Set Beyond Range)

For Example, A Typical Mp3 File Contains As Many As 10,000 Audio Frames, And Some Non-Mp3, ID3 Tags.. ..Usually, There Are No False, Or Bad Frame Headers In A File..But, Ocassionally, Bad Frames Exist, So The Default Setting For The .BadFrames. Property = 10000. .You May Set The .BadFrames. Property To = 0, If You Want To Require SpecX4 To Allow No Bad Frame Headers... Note: SpecX4 Does Not Analyze The Audio Data In A Frame.. . A Bad Frame In This Case Is A 32-Bit Frame Header Which Contains Invalid Specifications, Or Which Is Not Located Where It Should Be.. It Is Posible For A Contaminated Mp3 File To Contain A Long String Of Several Hundred, Or Even, Posibly, Several Thousand Bytes, And With Each Byte Reading As A Bad Frame Header.. However The File Might Play, Without A Problem, In Many Players.

____________________________________________________________________________________________________

Minimum = 100,000 ... Default = 500,000 .... Maximum = 2,500,000 ...(Will Auto-Reset To Default If Set Beyond Range)

This Property Can Be Increased If Extremely Large ID3V2 Tags Are Encountered At The Beginning Of Mp3 Files Or If Variable BitRate Files, Without An "Xing" Header, Are Encountered Which Have A Larger Than Normal Number Of Frames At The Beginning Of The File With The Same BitRate, So That Reading More Frames Is Required In Order To Establish That The File Is Not Fixed BitRate, And More Bytes Are Required To Read More Frames.. This Is Not Typically, Required, At Present, In Most Files.

The Smaller The Settings For .FastBytesMax. And .FastFramesMin., The Faster SpecX4 Will Scan Files., But You May Sacrifice Some Accuracy At The Fastest Speeds If There Are Large Non-Mp3 Tags To Scan Through, Or If A Variable Or Average Bitrate File Begins With Too Many Consecutive Frames Of the Same Bitrate.

Caution: It Is Posible To Set The .FastBytesMax. Property To Low, In Relation To The .FastFramesMin. Property Being Set To High, In Which Case You Could Get Null Return Values For A File Which Is A Valid Mp3 File. Consider Frame Lengths To Be Approx. ...(BitRate * 144) / Frequency.. So, For Example, In A 320 Kbit, 44100 Hz, Mp3 File, 200 Frames Would Exceed 200,000 Bytes In Length. There Might, Also, Be An ID3v2 Tag At The Beginning Of The File, Before The Audio Begins.. .. So, If .FastBytesMax. Is Set To 100,000 Bytes, And If .FastFramesMin. Is Set To 200 Frames, It Would Be Imposible To Find 200 Frames Before Arriving At The 100,000 Byte Limit.

____________________________________________________________________________________________________

Minimum = 10 ... Default = 25 .... Maximum = 200 ...(Will Auto-Reset To Default If Set Beyond Range)

If No "Xing" Header Is Found, The FastScan Method Compares The BitRate Of Each New Frame It Finds With All Of The Previous Frames It Has Found In A File.. If, Any Frame Has A Different Bitrate, Then File Is A Variable Bitrate File. If No "Xing" Header Is Found, Then The Return Value For The BitRate Property Will Be "VAR" And The PlayTime Property Will Be A Null String.. If A Variable Or Average Bitrate File Begins With Too Many Consecutive Frames Of the Same Bitrate, And If FastFramesMin Is Set Too Low, The FastScan May Fail To Detect That The File Is Not A Fixed Bitrate File, And Then Return, Typically, A Low Value For The BitRate Property And A High Value For The PlayTime Property, And Both, Incorrect.

In Testing, The Minimum Value Read Every Test File Correctly. ..The Default Provides An Additional Safety Margin... Greater Settings For The FastFramesMin Property May Be Used If Variable Or Average Bitrate Files Are Evaluated Incorrectly.

____________________________________________________________________________________________________

Minimum And Default = 500,000 .... Maximum = 2,500,000 ...(Will Auto-Reset To Default If Set Beyond Range)

This Setting Might Be Increased If An Extremely Large Amount Of Non-Mp3 Data, Such As An ID3v2 Tag, were Located At The Beginning Of A File.

____________________________________________________________________________________________________

Minimum = 10 ... Default = 100 .... Maximum = 200 ...(Will Auto-Reset To Default If Set Beyond Range)

The Primary Purpose Of This Setting Is To Stop The Full Scan From Reading For Too Long In An Extremely Large Non-Mp3 File.

This Setting May Be Decreased For Extremely Small Mp3 Files.. There Are Approx 38.3 Frames Per Second Of Mp3 Play Time.

____________________________________________________________________________________________________

____________________________________________________________________________________________________

Back Up.

Compile, Package, And Deploy

If You Are Using mp3SpecX4.dll In A Visual Basic 6.0 Project, As Detailed Above In "Using mp3SpecX4 In A Visual Basic 6.0 Project," And You Compile Your Project Using Visual Basic's IDE And Package Using The Package And Deployment Wizard, Then This Is An Automated Process, And mp3SpecX4.dll Will Be Included In Your Setup Package And Installed Correctly, Like Any Other, "Standard" ActiveX Component Or Control .DLL, Or .OCX. .. (As Always, Before You Distribute Any Visual Basic Application, You Should Test Your Installation On A Clean Machine ... See Visual Basic's IDE Help For More Details)

Additional Information:

In Your Development Environment, mp3SpecX4.dll And mp3SpecX4.DEP, It's Dependency File Which Tells You Or The Package And Deployment Wizard The Names Of Additional Run Files Which mp3SpecX4.dll Needs, Are Both Located In Its Install Directory, (Default ...C:\Program Files\mp3SpecX4\ ....). The Run Files Specified By mp3SpecX4.DEP Are The Standard Set Of Run Files Which Must Go With Any Visual Basic Application, So mp3SpecX4.dll Will Not Add Much Weight To Your Visual Basic Package (56 KB Uncompressed).

In The End User's Computer, Where Your Application Installs, mp3SpecX4.dll Should Be Installed In Your Application's Install Directory With Your .exe File. Your Application's Package Should Not Include mp3SpecX4.DEP.

If You Use The aaMD532.dll In Your Application, And Package It Using The Package And Deployment Wizard, When Prompted, "Missing Dependencies", Ckeck "Mark Permanently As Having No Dependencies". ...Later, When The Install Destination Window Appears, Change Its Destination From WinSysPath$ To AppPath$, Same As Your Application's .exe File. This Seems To Work Fine.

____________________________________________________________________________________________________________

 

Installation Files

mp3SpecX4.ZIP (Download File) Contents: (4 Files) This Installation Does Not Contain Most Of The Visual Basic Runtime Files Already On Your Machine If You Have VB 6.0, Or Contains Older Versions Which Will Not Intrude Or Overwrite Your Later Versions Of Visual Basic 6.0 Runtime Files Or Any Of Your Windows 98 Systems' Files, But Will Run Using Your Runtime Files.

mp3SpecX4.dll-Help.htm - This Help File With Installation Instructions And Complete Guide To Using mp3SpecX4.dll In Your Visual Basic Applications. This File Is Accessible After You Un-Zip, So You Can Read It Before You Run The Install Program.

setup.exe - Installation Program.(Part One)

Setup.lst - Reference File used By The Install Program.

mp3SpecX4.Cab - Compressed .Cab File Contents: (11 Files)

mp3SpecX4.dll - Vs 3.0.2 ActiveX Dll Component.

mp3SpecX4.DEP - Dependency File, Required For You To Be Able To Package mp3SpecX4.dll In Your Applications.

Setup1.exe - mp3SpecX4.dll Installation Program.(Part Two)

St6unst.exe - UnInstall Program. Can Be Used To Completely Remove mp3SpecX4.dll And Any New Files Installed With It, And Their Registration On Your Machine.

Test_mp3SpecX4.vbp ...... Test_mp3SpecX4.vbw ...... Test_mp3SpecX4_Form1.frm ...... Test_mp3SpecX4_Form1.frx - A Sample Visual Basic 6.0 Project, Which Demonstrates Using mp3SpecX4.dll (Contains Only Standard Edition Visual Basic Components).

Vb6stkit.dll - A VB 6 Run File, Used By The Installation Program. Vs.6.00.8169 June 18, 1998 (Early Version Is Used And Will Not Overwite Your Later Version)

aaMD532.dll This Distribution Of mp3SpecX4.dll Contains aaMD532.dll, a 'C' Language Component, Which Returns 32 Byte MD5 Checksums Of Strings, Used By Many .mp3 File Sharing Client And Server Applications. It's Use Is Demonstrated In The Test_mp3SpecX4.vbp Sample VB 6.0 Project.

The Author of ..aaMD532.dll: ...Is Francisco Carlos Piragibe de Almeida.

aaMD532.dll ...Is Derived From The MD5 Message-Digest Algorithm...By RSA Data Security, Inc.

(These Two Credits Are Required If You Use And Distribute The aaMD532.dll With Any Of Your Applications.)

Important Note: Other Basic Visual Basic 6.0 Runtime Files And Windows Application Extension Files (Not Included) Are Required To Run The Installation Program. And mp3SpecX4.dll....If You Have Visual Basic 6.0 They Will Be On Your Machine Already. If Not, The Files Are Available, Free, From Many Download Web Sites. These Files Are: Msvbvm60.dll - Oleaut32.dll - Olepro32.dll - Asycfilt.dll - Stdole2.tlb - Comcat.dll - about 2.2 Mb Total - Uncompressed.

___________________________________________________________________________________________________________

License

mp3SpecX4.dll Is Freeware for Freeware Developers (our definition is no considerable, consequental, or sympathetic revenues), And May Be Used, Royalty-Free, In End-User, Non-Component, Type Applications.

mp3SpecX4.dll Is Shareware For Shareware Developers, And May Be Used, Royalty-Free, In End-User, Non-Component, Type Applications By Developers Who Have Purchased A Prepaid License. ....Without A Prepaid License, There Is A Royalty Equal To 5% Of Container Application Sales... You Can Eliminate The Royalty Obligation, Initially, Or Later, By Purchasing The Shareware License

Otherwise, mp3SpecX4.dll May Be Used In Other Types Of Non-Component, Or Component Type Applications By Contractural Arrangement. We Have In The Past, And Can Supply Custom Versions Of mp3SpecX4.dll's Class Module To Developers Who Want The (Modifiable) Source Code To Compile Within Their .exe Files.

Purchase Shareware License Clink The RegSoft.Com Link Below To Purchase The Royalty-Free, Shareware Licence To Distribute mp3SpecX4.dll In Your End-User, Non Component, Shareware Applications.

RegSoft.com - ...mp3SpecX4.dll . .Secure Order Page

RegSoft.com - ...mp3SpecX4.dll . .NonSecure Order Page

Supplier Makes No Warranty As To Suitability For Any Specific Purpose.

____________________________________________________________________________________________________

Additional Information About Objects

There Are Many Ways To Structure Declarations And Code To Use The SpecX4 Class Object Supplied By mp3SpecX4. . The Sample Application Is Just One Way To Go.

If You Aren't Familiar With Programming With Components, You Can Find Additional Information In:

+ MSDN Library

+ Visual Basic Documentation

____________________________________________________________________________________________________

About mp3SpecX4

mp3SpecX4 Reads Files Using ISO Standard 11172-3 Definition And Interprets.

____________________________________________________________________________________________________

Speed... At Default Configuration Settings...Approx. Speed Estimates, May Vary Considerably Depending On A Number Of Factors....

FastScan ... (12.5 x Processor Speed In Hundred Millions) Files / sec....So, In A 120 MHz Processor ..12.5 x 1.2 = 15 Files / per sec. .......In A 566 MHz Processor.12.5 x 5.66 = 70.8 Files / per sec. .......In A 1.2 GHz Processor.12.5 x 12 = 150 Files / per sec.

FullScan ...The Number Of Minutes Of Play Time In The File / Processor Speed In Hundred Millions ..sec... So It Will FullScan A 4 min.-30 sec. Variable Bitrate File, In A 120 MHz Processor In ...4.5 / 1.2 = 3.75 sec....In A 566 MHz ...4.5 / 5.66 = 0.8 sec. ...In A 1.2 GHz ...4.5 / 12 = 0.375 sec.

Repeat Scans Of The Same Files Are About 1.5 to 2 Times Faster Due To Processor, Op. System, Or Visual Basic Caching.?

____________________________________________________________________________________________________

Some Awareness Of Mp3 Files In Existance Has Proved That About 1% to 3%, Or More Contain Some Bad Data.. Even So, These Files May Play Just Fine For Most Practical Purposes. mp3SpecX4.dll Has Been Structured To Deal With Bad Data, And Can Be Configured To Modify The Way It Reacts To Bad Data, However, There May Be Mp3 Files In Existance Which It Can Not Read Correctly. . And mp3SpecX4.dll Has Not Been Tested On An Enormous Number Of Files.

I Would Appreciate Any Information You Might Offer, Related To The mp3SpecX4.dll, Which Might Help Me To Improve It.... Any Information Related To Installation, Packaging, Accuracy, Speed, Configuration Settings, Or Etc.

Feed-Back: ..Subject:... mp3SpecX4.dll ...... eMail To:... mpsoft3@alltel.net

Web Site:... http://tudir.50megs.com

Back Up.

Copyright 2000 - 2001 Michael Messer