Not a Member Yet,
Click here to Register

ID: 403
Viewed: 3446
Added: Aug 19, 2002
Version:
Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

Working with MP3

Does your program need to work with MP3 files? Creating your own audio program or music library and need to automatically extract details such as the artist, track title and album? Perhaps you even need to overwrite such ID3 tags?

The winner of our SmartUI competition, MuchMetal shows us how with this neat class.

To get details of a particular MP3, firstly, set the Filename property. Then check that the isActive property is set to True, indicating you have referenced a valid MP3 file. Next, read the appropriate properties, such as Title, Artist, Album and Genre.

You can also change any of these properties, then save 'em back to the original file with the SaveTag method.

To learn how to play MP3 files from within Visual Basic, check out this neat tutorial from our partner in code, VBWeb.co.uk.
to download this code in a class file-
http://www.vb-world.net/tips/clsid3.cls

Highlight all by clicking in box
<!---Declaration--->
none

Highlight All
<!---Code--->
Sample Code

Dim MP3 As New clsID3
MP3.Filename = "c:ChrisRea.mp3"

If MP3.isActive = True Then
'Get ID3 information about MP3
MsgBox "MP3 Info:" & vbCrLf & vbCrLf & _
"Title:" & vbTab & MP3.Title & vbCrLf & _
"Artist:" & vbTab & MP3.Artist & vbCrLf & _
"Album:" & vbTab & MP3.Album & vbCrLf & _
"Year:" & vbTab & MP3.Year & vbCrLf & _
"Genre:" & vbTab & MP3.Genre & vbCrLf & _
"Comment:" & vbTab & MP3.Comment

'Change the ID3 information
MP3.Artist = "New Artist 2"
MP3.Title = "New Title 2"
MP3.Album = "Some Album 2"
MP3.Comment = "Created using clsID3 2"
MP3.Year = "2000"
MP3.Genre = 54

MP3.SaveTag 'Saves the new ID3 information

Else 'Error opening MP3 file
MsgBox "Invalid MP3 file"
End If;


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2024 snippetlibrary.com All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!