appending information to wave files

  • Thread starter Thread starter Xavier Valdés
  • Start date Start date
X

Xavier Valdés

Hi all,

I wanted to add metadata in my wave file. I've read something about streams
but I don't know which is the common usage of them for my purpose. I wanted,
for example, to add the
lyric of a song in my wave file but I want to remain its compatibility with
wmplayer and other
players...
So, what about using streams?
Any good article about that (for my special purpose!)????
Thanks a lot,
Xavi
 
Here is what i have done:


Private Sub writeMetaData(ByVal filePath As String, ByVal ObjectToSave As
clsSongInfo)
Try
Dim fsNewFile As New IO.FileStream(filePath, FileMode.Open,
IO.FileAccess.ReadWrite)

Dim binWriter As New BinaryWriter(fsNewFile)
binWriter.BaseStream.Seek(-129, SeekOrigin.End)
With ObjectToSave
Dim sTitle As String = pad(.Title, 30)
Dim sArtist As String = pad(.Artist, 30)
Dim sAlbum As String = pad(.Album, 30)
Dim sYear As String = pad(.Year, 4)
Dim sComments As String = pad(.Comments, 30)

binWriter.Write("TAG" & sTitle & sArtist & sAlbum & sYear &
sComments)
End With
binWriter.Flush()
binWriter.Close()
fsNewFile.Close()
Catch ex As Exception
handleErr(ex)
End Try
End Sub


clsSongInfo is a class designed to hold the attributes of the meta data file.

Hope this helps.

KiteOregon
 
Oks, Kire. Thank you very much but...
What about if I want it to be a hidden information???
I mean... I do not want information to be saved on to the base stream but on
another stream!

I don't want to modify original file cause I just want to see my metadata
when I type that command :
"more<testfile:MyStreamName"

Any idea???
 
Back
Top