473,322 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Problem with loop reading wma metadata

Folks,

Im not sure if this would have been better going to this group, or a
windows media one! Oh well...

Im using fitnesse (for those that know it) to test an app that among
other things can rip WMA from CD. I have a class library that calls
the app's public methods to set track, destination, format etc, and do
the rip. Im then using the media player SDK in the following code.

What I dont get is, why *some* tracks return "builtlist" as 8 of the
metadata fields, whilst others return something like 23 - yet the
looping and code is exactly the same for each track iteration - the
only thing Im changing is the track no to rip, and the bitrate to rip
to/with - further research has shown that it seems to be the track no
that is the significant change.

Can anyone offer any suggestions / explanations?

(Im afraid this is just the first of a few current questions - I'll
not post the others yet in case the solution to this has a knock-on
fix for the others!)

Cheers

Steve

Code:
public string FileFormatInfo()
{
string strPath = UriOfTrack.AbsolutePath;
StringBuilder myBuiltString = new StringBuilder(strPath);
myBuiltString.Replace("/", "\\", 0, strPath.Length);
myBuiltString.Replace("%20", " ", 0, strPath.Length);
strPath = (Convert.ToString(myBuiltString));
Microsoft.MediaPlayer.Interop.WindowsMediaPlayerCl ass
myplayerclass = new
Microsoft.MediaPlayer.Interop.WindowsMediaPlayerCl ass();
Microsoft.MediaPlayer.Interop.IWMPMedia mymedia =
myplayerclass.newMedia(strPath);
string builtlist = "";
string[] attrs = new string[] { "AcquisitionTime", "AlbumID",
"AlbumIDAlbumArtist", "Author", "AverageLevel", "Bitrate", "BuyNow",
"BuyTickets", "Channels", "Copyright", "CurrentBitrate", "Duration",
"FileSize", "FileType", "Is_Protected", "IsVBR", "MediaType",
"MoreInfo", "PartOfSet", "PeakValue", "PlaylistIndex",
"ProviderLogoURL", "ProviderU,L", "RecordingTime", "RecordingTimeDay",
"RecordingTimeMonth", "RecordingTimeYear", "RecordingTime,earMonth",
"RecordingTimeYearMonthDay", "ReleaseDate", "ReleaseDateDay",
"ReleaseDateMonth", "Rel,aseDateYear", "ReleaseDateYearMonth",
"ReleaseDateYearMonthDay", "RequestState", "ShadowFilePath",
"SourceURL", "SyncState", "Title", "TrackingID", "UserCustom1",
"UserCustom2", "UserEffectiveRating", "UserLastPlayedTime",
"UserPlayCount", "UserPlaycountAfternoon", "UserPlaycountEvening",
"UserPlaycountM,rning", "UserPlaycountNight", "UserPlaycountWeekday",
"UserPlaycountWeekend", "UserRating", "UserSer,iceRating", "WM/
AlbumArtist", "WM/AlbumTitle", "WM/Category", "WM/Composer", "WM/
Conductor", "WM/ContentDistributor", "WM/ContentGroupDescription", "WM/
EncodingTime", "WM/Genre", "WM/GenreID", "WM/InitialKey", "WM/
Language", "WM/Lyrics", "WM/MCDI", "WM/MediaClassPrimaryID", "WM/
MediaClassSecondaryID", "WM/Mood", "WM/ParentalRating", "WM/Period",
"WM/ProtectionType", "WM/Provider", "WM/ProviderRating", "WM/
ProviderStyle", "WM/Publisher", "WM/SubscriptionContentID", "WM/
SubTitle", "WM/TrackNumber", "WM/UniqueFileIdentifier", "WM/
WMCollectionGroupID", "WM/WMCollectionID", "WM/WMContentID", "WM/
Writer", "WM/Year" };

foreach (string attrname in attrs)
{
if (mymedia.getItemInfo(attrname) != "")
{
builtlist = builtlist + attrname + ":" +
(mymedia.getItemInfo(attrname) + "<BR>");
}
}
return builtlist;
}

Mar 15 '07 #1
1 2198
On Mar 15, 9:11 am, "Renster" <steveh...@hotmail.comwrote:
Im not sure if this would have been better going to this group, or a
windows media one! Oh well...

Im using fitnesse (for those that know it) to test an app that among
other things can rip WMA from CD. I have a class library that calls
the app's public methods to set track, destination, format etc, and do
the rip. Im then using the media player SDK in the following code.

What I dont get is, why *some* tracks return "builtlist" as 8 of the
metadata fields, whilst others return something like 23 - yet the
looping and code is exactly the same for each track iteration - the
only thing Im changing is the track no to rip, and the bitrate to rip
to/with - further research has shown that it seems to be the track no
that is the significant change.
If you view the file attributes in explorer, do you see all of them
even in the ones that only return 8 of them in your code?

Jon

Mar 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris | last post by:
Hi all, I have recently started working with the new XML functionality in PHP5, but I am running into a few problems. Specifically, I am using an Xpath query to try and pull out the data in...
3
by: Christian Caron | last post by:
Hi all, I have a page which contains the following tag: <head> <meta name="date_modified" content="20030730" /> </head> (...) <script> (...)
3
by: Omer van Kloeten | last post by:
The Top Level Design: The class Base is a factory class with a twist. It uses the Assembly/Type classes to extract all types that inherit from it and add them to the list of types that inherit...
1
by: Alex Borghgraef | last post by:
Hi all, I'm trying to get the Limp (Large Image Manipulation Program) library to compile using gcc 3.2, and I've encountered some problems. One is that the library systematically refers to...
1
by: jrmsmo | last post by:
Hi there, I have an interesting problem that maybe you pros can suggest how I solve. I'm working with a third party program that serializes an XML document (it was obviously not designed with schema...
2
by: belangour abdessamad | last post by:
Hi all, Does please any body have any documentation and sample code for reading dotNet metadata with C# ? Thanks.
2
by: Mad Scientist Jr | last post by:
i'm trying to read a file byte by byte (and later alter the data and write it to a 2nd file byte by byte) and running into a problem where it seems to keep reading the same byte over and over again...
9
by: Thomas Helmke | last post by:
Hello NG. I'm trying to read in a textfile. I will give you an extract of my code: bool LogfileHandle::ReadFile( string filename ) { std::ifstream LogFile( filename.c_str() ); if(...
4
by: comp.lang.php | last post by:
'll try to explain this as clearly as possible, sorry if it's unclear. You have in your directory /foo 42 images You have in your database metadata for 30 out of those 42 images You have to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.