Frank Peters
Guest
|
Posted:
Tue Sep 21, 2004 1:04 am Post subject:
displaying embedded cover art in wma file |
|
|
I am getting a runtime error trying to retrieve the WM/Picture metadata
from my test wma file.
ERROR when executing: pic = media.getItemInfoByType("WM/Picture", "", 0)
An unhandled exception of type 'System.ArgumentException' occurred in
WindowsApplication2.exe
Additional information: The parameter is incorrect.
Here is a snippet from my code
Any help would be greatly appreciated
Thanks
John
Imports WMPLib.WindowsMediaPlayerClass
Public Class Form1
Inherits System.Windows.Forms.Form
Dim AlbumName As String
Dim ArtistName As String
Dim SongName As String
Dim Path As String
Dim WithEvents mplayer As WMPLib.WindowsMediaPlayer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
mplayer = New WMPLib.WindowsMediaPlayer
mplayer.URL = Path.Text
mplayer.controls.play()
Dim media As WMPLib.IWMPMedia3
media = mplayer.newMedia(Path.Text)
** These calls succeed **
AlbumName.Text = media.getItemInfo("WM/AlbumTitle")
ArtistName.Text = media.getItemInfo("Author")
SongName.Text = media.getItemInfoByType("Title", "", 0)
Dim pic As WMPLib.IWMPMetadataPicture
** The following call causes the error:
System.ArgumentException
The parameter is incorrect.
**
pic = media.getItemInfoByType("WM/Picture", "", 0)
|
|