I have a class that pulls the ID3 information from an MP3 file. This information is at the very end of the file in plain ASCII. The original author is using FileGet to retrieve just the last 127 characters of each mp3 file. The issue is that this information is put into strings declared like this...
This part all works fine. But I'm trying to code a property that returns a string like this...
But for some odd reason it is being very strict about the length of the returned string. It usually just returns the strTitle, and not the " - " or strArtist, and if I switch the positions, it will just return strArtist. So obviously both Strings have information in them.
I'm an intermediate programmer, but just breaking into VB.NET. I'm not sure what the New String(" ",30) part does, but it is definitely interfering with the string concatenation that I'm trying to return. Anyone ever had a similar issue?
I've tried String.Copy, String.Concat, etc. I've also tried doing ReadtoEnd(), but it takes forever for just 10 mp3 files, so I can't imagine how long it would take with a whole library. The only thing that slightly works is if I do...
But like I said, coincidentally it will only return around 30 characters.
VB.NET:
Public strTag As New String(" ", 3)
Public strTitle As New String(" ", 30)
Public strArtist As New String(" ", 30)
FilePut(intFile, strTitle)
FilePut(intFile, strArtist)
FilePut(intFile, strAlbum)
This part all works fine. But I'm trying to code a property that returns a string like this...
VB.NET:
return strTitle & " - " & strArtist
But for some odd reason it is being very strict about the length of the returned string. It usually just returns the strTitle, and not the " - " or strArtist, and if I switch the positions, it will just return strArtist. So obviously both Strings have information in them.
I'm an intermediate programmer, but just breaking into VB.NET. I'm not sure what the New String(" ",30) part does, but it is definitely interfering with the string concatenation that I'm trying to return. Anyone ever had a similar issue?
I've tried String.Copy, String.Concat, etc. I've also tried doing ReadtoEnd(), but it takes forever for just 10 mp3 files, so I can't imagine how long it would take with a whole library. The only thing that slightly works is if I do...
VB.NET:
return strTitle.SubString(0,5) & " - " & strArtist.SubString(0,5)
But like I said, coincidentally it will only return around 30 characters.
Last edited: