1) V2Duration Usage example

'Reads...
you can get them here:
'In this example, I have named it "Flowers.v2m".

'Set a reference to the V2Duration.dll : "Project" -> "Add reference" -> browse for V2Duration.dll .
'Now setup the Import once to avoid too long declarations:

Imports V2Duration.V2Duration

Note: Put the following lines of code into a Sub!

'Declare a calculation class object:

Dim V2Duration = New V2Duration.V2Duration

'Now I show you 2 options to read a *.v2m music file:
'From a path or the Programs Ressources.
'Choose the suitable option for your usage!

'1) Read the *.v2m file from a path (to a Bytearray):

Dim File() As Byte = My.Computer.FileSystem.ReadAllBytes("C:\Users\Freefall\Desktop\Flowers.v2m")

'2) Read the *.v2m file out of the Programs Ressources (to a Bytearray):
'Of course you need to put it into the ressources before!
'To do this, goto "Project" -> "Properties" -> "Ressources" -> drag & drop the file in.

Dim File() As Byte = My.Resources.Flowers

'-> Finally use the calculation function to show the music duration time:

MsgBox("The duration is " & V2Duration.CalcV2Dur(File).ToString & "s.")

Last edited Apr 19, 2013 at 10:37 AM by Freefall, version 4

Comments

No comments yet.