Xigga

Enter the XM.
RSS icon Email icon Home icon
!
  • .NET ID3 Library Released! - v0.5

    Posted on April 21st, 2009 XM 7 comments

    Ok, I’ve decided to release the library.  It can only read ID3 tags currently, and it does a good job.  My next step is to make it write ID3 tags.  You can download the DLL from the link below.

    Click Here to Download!

    Here is some quick info on it.  It is a .NET 2.0 assembly created in Visual Studio 2008.  You can still use it in Visual Studio 2005.  It is all .NET code and does not depend on another library.  I built it with Any CPU setting so it should work on x86 and x64 systems.  You can use it in VB.NET or C#.

    And this is how you use it.  Just add a reference to my DLL in your project.  You will need the VS2008 runtime files if you don’t have Visual Studio 2008 installed.  You just need to use the following code:

    Sample Code

    You can then look at the TagReader object’s properties to get the ID3v1 tag and the ID3v2 tag.  My library supports reading ID3v1, ID3v1.1, ID3v2.2, ID3v2.3, and ID3v2.4 tags.  ID3v1/1.1 tags are very simple.  ID3v2 tags are more flexible and a little complex.  Each tag is written as a “frame”.  So you can have many tags, up to the physical limit.  So you will see AddFrame(), GetFrame(), etc. methods for the frames in the ID3v2Tag object.  You can use GetAllFrames() method to get all the tags, and you can see how they are formatted.  You can goto www.id3.org and look at the developer section on a overview of ID3v2 tags.  The common artist, album, title, etc. tags I have added properties for them for ease of use.

    I strongly suggest you use Visual Studio’s Intellisense feature.  I don’t want to get stupid emails asking how to get this or that. If you don’t know what Intellisense please do a Google search for it and learn how to use it.  I have to deal with stupid developers at work already who don’t use Intellisense.

    Thanks

  • .NET ID3 Library: Update 3!

    Posted on April 6th, 2009 XM 3 comments

    Hello Everyone!

    I know I’ve been saying this for the past year and a half, but I am still working on the library.  I have made so many changes to it that it is totally different from what I started with.  I was doing a lot of stupid things and I thought to my self “WTF was I thinking?!”.  I re-wrote most of the code to make is short (fast).  You won’t believe what kind of stupid things I was doing.  Anyways, this should make it a lot faster then it was before.  I still have to test it.  I would love to release it now, but I don’t want to release a broken solution.  Thanks for your patience!

  • How to get hard-drive serial number without WMI.

    Posted on November 18th, 2008 XM No comments

    Here’s a simple code snippet to get the HDD’s serial number in .NET (C#). You can use Windows Management Instrumentation (WMI), but it seems like more code and more error checking.

    class Program
    {
    [DllImport("kernel32.dll")]
    private static extern long GetVolumeInformation(string PathName, StringBuilder VolumeNameBuffer, UInt32 VolumeNameSize, ref UInt32 VolumeSerialNumber, ref UInt32 MaximumComponentLength, ref UInt32 FileSystemFlags, StringBuilder FileSystemNameBuffer, UInt32 FileSystemNameSize);

    static void Main(string[] args)
    {
    Console.WriteLine(GetVolumeSerial("c"));
    }

    public static string GetVolumeSerial(string strDriveLetter)
    {
    uint serNum = 0;
    uint maxCompLen = 0;
    StringBuilder VolLabel = new StringBuilder(256); // Label
    UInt32 VolFlags = new UInt32();
    StringBuilder FSName = new StringBuilder(256); // File System Name
    strDriveLetter += ":\\"; // fix up the passed-in drive letter for the API call
    long lRet = GetVolumeInformation(strDriveLetter, VolLabel, (UInt32)VolLabel.Capacity, ref serNum, ref maxCompLen, ref VolFlags, FSName, (UInt32)FSName.Capacity);

    // Get it in hex format.
    return serNum.ToString(”X”);
    }
    }

  • .NET ID3 Library: Update 2

    Posted on August 13th, 2008 XM 10 comments

    Hello Everyone,

    I just did a major re-write to my library. The code is very optimized now. Before I had a lot of unneeded functions, objects, and buffers (OMG!). I was able to knock out a lot of stuff. The only CPU intensive aspect of the library is detecting the MPEG Audio Info. For those of you who don’t know what it means, MPEG Audio Info contains information about the actual audio stream, like bitrate, sample rate, channels, duration, etc. That information is not part of the ID3 tag. Since MP3’s are stream based, each audio sample has its own MPEG Audio header. The trouble is detecting if the data is MPEG Audio Info or if it’s just the audio stream. What I am doing right now is, I’m parsing the whole MP3 file and reading all MPEG Audio Info patterns and doing a complex check to see if it’s a valid MPEG Audio Info header. This is taking up most of the CPU time. It’s all done in memory, but it’s still a big hit to performance.

    I’m going to continue finding a better way to detect valid MPEG Audio Info headers without doing a cross check with the other headers. Also I’m ignoring all MPEG Audio Info headers if they say anything other than MPEG 1 Layer 3. Some people may have MPEG 1 Layer 2, or other combinations. So my library won’t work with that.

    Other good news is that it will read the ID3 information very fast! :) My library currently sits at 52kb. It only reads ID3 tags, but it reads all the versions. My next step is to make it write ID3v2.4.0 and ID3v1.1 tags. I’m not going to add support for writing ID3v2.3.0 or ID3v2.2.0 tags. I may allow the option to append the ID3v2.4.0 tag, instead of removing the old one. That’s just a thought. I would rather have the older tags be removed and just have ID3v2.4.0 and ID3v1.1.

    I know a couple of you guys out there are eager to try out my library. I would say I’m at version 0.5. It’s easy to parse TEXT tags, but binary tags, like the Image tag, I don’t have support for decompressing the JPEG or any other format yet. I’m definitely not going to write my own image decompresser. If there’s code already available, then I’ll just use that, if not, you will still have access to the raw byte array of the JPEG image in memory, so you can use your own library to decompress/compress it.

    Once I have tested my current build (0.5), I will release the library and I’ll provide some sample code on how to use it. It’s pretty simple. You can read all the tags/information with just two lines of code. Hopefully, I’ll get done with my work project so I can work on this more.

  • PC to HDTV

    Posted on June 14th, 2008 XM No comments

    Don’t let your HDTV go to waste.  Use it as a monitor.  You can hook up any laptop or PC to your HDTV.  HDTV’s are better monitors than the specially designed monitors for the PCs.  You get higher contrast ratios and a bigger screen!  You can play your videos games, or watch movies.

    Your laptop/PC will either have a VGA or DVI connection.  Newer PC/laptops have DVI, older ones (2+ years old) will most likely have VGA.  HDTVs older than 2 years had DVI, but they dropped it and now only have VGA.  DVI was dropped because of HDMI.  Hi-end laptops and PCs will have HDMI, in that case you just need to get the a HDMI cable.  If you HDTV has VGA and you laptop/PC has DVI, then you should’ve been given a DVI-VGA adapter.  If not, then you can find it cheap online.  It’s also possible that your TV has VGA and your laptop/PC has DVI.  You use the same adapter!

    Watching movies on the PC is the best thing because they can play any format.  Some of you may have Windows XP Media Center Edition.  You can tell by going to Start > All Programs > Accessories > Media Center.  Just start that up and you have a nice little media center.  You PC may also have a SP/DIF or optical audio connection.  You can hook that up to your receiver and get 7.1/5.1 surround sound.

    No need to burn DVDs or CDs anymore.  Hardrives are very cheap these days.  You can get drives that are $0.20 per gigabyte.  Just search around on the Internet.  You’ll find very good prices, and if you’re not in one of those “weird” states, you won’t have to pay taxes.

    You can also play HD movies on your computer if it can handle it.  Bluray drives cost about $350-$500 for your computer.  Put one in and you got yourself a Bluray player.  You need a dual-core system to play Bluray movies.

    Within a few years HTPC (Home Theater PC) will be the new thing.  It’s puts everything into a nice little box.  But HTPCs don’t have special “technology” to make it better for your HDTV than your current computer.  If your computer has SP/DIF or optical out, then you are good to go.  A decent video card would make it better because HDTVs are 1920×1080 @ 60hz.  The new HDTVs are 1920×1080 @ 120hz, so if you want to get the best of the best, get a good video card that can handle that resolution.

  • Get Free Local HD Channels

    Posted on June 9th, 2008 XM 1 comment

    There’s an easy way to get your local channels free in HD. Just get a HDTV antenna. Instead of paying $5-$10 extra per month to get local channels, just invest in a HDTV antenna. The HDTV antenna isn’t for everyone. If you are too far away from the broadcasting station, you will have trouble picking up some or all the channels.

    I like the Terk HDTVi VHF/UHF HDTV Indoor Antenna. It’s cheap and it’s good. But it’s up to you, you can read the reviews and decide for yourself. You can also look at the other antennas they have. If it doesn’t work then you can return it. The antennas are mainly good if you are in a city, since that is where most broadcasting stations are. Spending $20-$40 on an antenna is better than paying your satellite/cable company for it. The charge you at least $5/mo. for local channels.

    This was a short article. I just wanted to get it out because not a lot of people know of this option. Enjoy your sports in HD!

  • SED TV

    Posted on May 31st, 2008 XM No comments

    SED stands for Surface-conduction Electron-emitter Display. Pretty long name, so lets just call it SED. SED technology is going to compete with LCD and OLED technologies. Plasma has no chance, read my previous article to see why. SED was created jointly by Canon and Toshiba.

    LCD is good, but you don’t get a high contrast ratio (yet). Even though we have Samsung out with a 500,000:1 conrast ratio, it’s not static. It’s dynamic contrast ratio. Read my article on contrast ratio here. High contrast ratio will be the biggest advantage for SED TVs. To find out why we first need to know how LCDs work.

    LCD TVs have pixels that are arranged in a nice grid. Each pixel can be any color, but the pixel doesn’t have it’s own light source to control the brightness of the color. Behind the grid panel, there is a light source called the back light. When LCDs first came out the backlight was a powerful tubelight. Now they have LEDs for the backlight, but it’s still one light source for all the pixels. So the pixels can only have a small contrast range. If one side of the screen is all white and the other side is black, the black side will look washed out, because the backlight is at it’s full brightness.

    Before I explain SED technology I need to explain CRT. CRT is the old picture tube technology that has been around for more than half a century. CRT stands for Cathode Ray Tube. CRT works by shooting an electron at a phosphorus screen with an electron gun. When the electron is shot at the screen it goes through a mask which allows the electron to hit only specific locations on the screen. when the electron hits the screen, it light’s that section up. The electron gun shoots electrons one by one in an orderly fashion. It starts from the left of the screen and goes all the way to the right, then it moves down to the next line and repeats the process until the whole frame is drawn. This happens very fast, so you don’t notice it at all.

    SED brings the best of both worlds together. In a SED TV each pixel is like a small CRT television. Each pixel has an electron gun and it shoots straight. In a conventional CRT, the electron gun shoots an electron, but since it has to draw on the whole screen the electron is deflected with a magnet at whatever angle it needs to be to hit the exact point on the screen. With SED you only need to shoot straight because you are using a grid of CRTs to display a picture. So in a SED TV, we have a grid of pixels, but the pixels are tiny CRT’s. This gives us the benefit of a higher refresh rate, because CRTs are fast at changing colors. LCDs are slow compared to CRTs. If you play videos games you will notice a ghosting effect in fast moving scenes. You can also notice this in movies with fast-motion scenes.

    With SED we also get higher contrast ratios because each pixel will have it’s own brightness. When an electron hits a phosphorus screen it emits light. And the light can be any color you wish and brightness. So SEDs don’t have a backlight, they don’t need one. An electron hitting a phosphor creates light! Simple put, an SED is like a LCD, but each pixel is a tiny CRT.

    You may think that we are moving backwards because CRT is old, but that’s not the case. CRT had some limitations, such as a maximum screen size it could shoot the electrons on. You can only change the electron’s trajectory so much. That’s why you never saw a 60″ CRT.

    Will SED make LCD obsolete? It’s possible, but LCD is always being improved. Let’s not forget Sony and how they like to push their technologies. When VHS was coming out they were pushing their Betamax, they lost. For the HD media they were pushing Bluray, and they won. Sony is going to be pushing OLED technology against SED. OLED is similar to SED, but instead of having tiny CRTs for pixels, it uses (Organic) LEDs. That’s all I can say about OLED for now. I’ll leave that for another article.

  • Contrast Ratio on HDTVs Important?

    Posted on May 27th, 2008 XM 1 comment

    Contrast ratio is the difference between the darkness and brightness (lightness). If you see an HDTV with a contrast ratio of 5,000:1, that means it can display 5,000 distinctive shades of gray, and that includes black and white.

    So is higher contrast ratio better? It depends on what type it is. Manufacturers are now advertising Dynamic Contrast Ratio, which is not the actual contrast ratio of the panel. The panel’s contrast ratio might be 1,000:1. DCR adjusts each frame with some sort of algorithm to produce an image that is comparable to the frame if it was shown on a panel that had a 5,000:1 static contrast ratio. (By “panel” I mean LCD or Plasma screen).

    How noticeable is it? Not very, because your eyes would need to see a DCR and a SDR panel side-by-side and a pitch-black room to notice it. Even then it depends on how sensitve your eyes are. To give you a quick lesson on physics (or biology), your eye’s perception of how bright an object is relative to other objects in the room. Let’s say you are in a room with the walls being completely black. You also have an omni-directional light source. You have several objects in the room which are different shades of gray. The lightest shade of gray will look white in that room. Now let’s paint the walls to super-white. Now that light-gray object will look gray to you because your eyes can only determine the brightness of an object relatively.

    Also, if you are watching TV in a room which has a light source, which will most likely be the case unless you have a dedicated home theater room, it will be even harder to notice the difference in contrast ratios. Even in the dark, if you have light colored walls, some of the light will reflect back on to the TV screen. This doesn’t mean you shouldn’t ignore contrast ratios when buying a HDTV. They are important, but make sure you find out what the static contrast ratio is. You should look up the TV specs online and most of the time the manufacturer will have it listed on the website. Majority of the time it will be in the product spec sheet, which is usually in PDF format.

    It’s not very easy to determine which TV will look better based on the DCR’s given. One TV maybe 10,000:1 and the other maybe 15,000:1, but it still depends on how well the second TV processes the frame. You should go down to your local retailer and have a look at the TVs. I haven’t been able to figure out what the actual algorithm for adjusting a frame with DCR is. My first thought was that it takes a frame and processes it to find how many shades it has. If it’s larger than the static contrast ratio of the panel, it “levels” the frame by shifting the brighness values down for each pixel. So if a frame’s darkest pixel is 500, it will set that pixel’s brightness to 0, and knock down the brightness of the other pixels accordingly. But it isn’t as simple as that. The only thing I was able to find about it is that it uses an algorithm called Iris, based on the eye’s iris, but that still doesn’t explain it. I have some further research to do…

  • Monster Cables: Do They Work?

    Posted on May 22nd, 2008 XM No comments

    You’re at the store looking to buy a HDMI, A/V, or Component cables. You see some that are $10, $20, $30…but then you see one that is $120. You are thinking WTF?! You start reading the package and it talks about how much quality you get with it and how it’s nitrogen injected to keep the naughty electromagnetic interference out. You decide to ask a salesperson just to make sure, and he says “Yeah, you’ll get the best quality with that”. So which one do you buy?

    A. $10 cable
    B. $20 cable
    C. $30 cable
    D. $120 Monster Cable

    If you answered D, you are an idiot! The correct answers were A, B, or C. When we’re dealing with short lengths of cables almost any cable will do. Except for those cheap $2 ones that are very thin and have cheap connectors. Most setups at home require a 6ft. (2m) cable. A short cable will not easily pick up interference, which is good. It’s only when you’re going at about 100ft. or more that you need higher quality cables. Even then I would not think of buying a Monster Cable. They are overly priced. If you want to buy good cables, go for Belkin or another brand with satisfied customers. If you don’t know if a brand is good, check online. Check customer reviews on consumer electronics sites.

    You can go and ask your Physics professor. He will tell you that it doesn’t make a big difference. You don’t need a super conducive material to get electricity to flow. Electricity flows through almost any metal. It’s only when you get up to 1000ft. or more that you think about material’s conductivity. And if you were running a cable that long, you could just increase the voltage. Of course, your audio video devices don’t have a voltage setting you can change. I was just giving you a scenario.

    Electricity moves at the speed of light, so you have nothing to worry about with your 50ft setups. If you have any questions, comments, or just want to argue, feel free to post.

  • Get The Best Picture Quality Out Of Your HDTV

    Posted on May 21st, 2008 XM No comments

    I will list several things you can do to get the best quality on your HDTV.  Many people I talk to say they don’t see much of a difference in watching something on an standard definition TV and the same thing on a HDTV.  Well, first things first.  If you have a HDTV that’s 27″ or smaller, you obviously won’t see a big difference.  The highest I’ve seen 27″ TVs go is 720p.  Which is a lot better than standard definition, but you’re not going to get a good “feel” of it.

    This guide will apply to 720p and 1080p TVs, unless otherwise noted.

    HDMI Cables - All most all audio/video devices bought in the last year (2007) will have HDMI.  HDMI allows you to get the full benefits of 1080p.  Component cables can’t handle the bandwidth required for 1080p.  The highest it will go is 1080i.  HDMI cables don’t cost a lot and you should not spend more than $30 for them.  You can buy HDMI cables online for 50% less then what you will pay at BestBuy, CircuitCity, or any retail stores.  Belkin is a good quality brand.  These you will find online and also, wholesale stores like Costco, sell these at great prices.  Do NOT buy Monster cables.  I will write an article about Monster cables tomorrow.  For now, just take my word for it.

    You don’t need HDMI cables for 720p HDTVs.  Component cables are good enough.

    Video Processors - Turn these things OFF.  These are the “fancy” features that HDTV manufacturers like to pitch to get you to buy their TVs.  Samsung has DNIe, Sony has Live Color Creation, and Pioneer has some crazy settings.  They don’t improve the quality.  They just “emphasize” some things in the video.  Sure it may look better at first, it’s not.  If the director wanted you to see it that way, he would’ve done so.

    Brightness/Contrast - Make sure your brightness isn’t all the way up.  It will make everything look white washed.  This will throw the color off, and make some objects on screen look bright even though they’re not supposed to be.  Make sure the contrast is not full also.  Contrast isn’t as bad as, but try some different contrast levels to see what is the proper level.  There are calibration DVDs you can buy to tweak these settings.

    Tint/Picture Mode/Color Level - Many TVs have settings like Warm, Neutral, Cool, and Vivid.  Warm adds a yellowish tint, Neutral won’t change the color levels, Cool gives a bluish tint, and Vivid just makes colors jump out.  You should keep this at Neutral.  If you’re watching a movie that’s taking place in a desert (Hidalgo), and you have your color level set to Vivid or Cool, it’s not going to give you the right affect.  You want to feel the heat!  Same is true if the setting of the movie is in the ocean (Deep Blue Sea) and you have your color level set to Warm.  Again, you won’t get a good feel of the movie.  Neutral sits in the green spectrum.  Which is considered neutral because it’s in the middle of the color spectrum.

    Sharpness - This setting varies from manufacture to manufacture.  You need a calibration DVD to set this.  But if you see a lot of noise or grainyness on the screen, try lowering it and see if it improves.  You can also use CGI animated movies to calibrate your sharpness.  Movies like Shrek 3, Ice Age: The Meltdown, or Cars.  Cars would be the best movie since it’s got varying degrees of color.  In Ice Age it will be harder to notice noise because of the lighter colors (white).  Don’t use live action movies, because they all have a tiny bit of grainyness/noise.  NOTE: Only use native 1080p sources (Blu-ray or HD-DVD) for this.  No Hi-Def TV channels.  You cannot be sure if the source from the broadcasting station was a certain resolution because they can upconvert it before it gets to your box or your cable/satellite provider.  Your TV will report what ever signal it is getting.  If you have a cable box hooked up with HDMI, it will report 1080p resolution for any channel, even SD channels.

    Upconversion - Upconversion means, the input video signal is not 1080p/720p and it needs to be scaled up to size.  If your DVD player, cable box, satellite receiver, or receiver (AMP) has a built in upconversion processor, try it out and see how it looks.  Then, try and see how your TV upconverts it.  Hook it up through component, composite, s-video, and co-ax (ewww).  Some TVs are good at upconverting and some aren’t.  Same goes for audio/video devices.  They may be better than your TV.  How do you know if your audio/video device has upconversion capabilities?  If you have a HDMI connection on it, then you can be 100% sure it will upconvert to 1080p.  If it has component, then check the manual.  Component can output from 480i to 1080i, anywhere in between.  Usually you can goto the menu and turn off upconversion through component and make it output at native.

    That’s it for now.  Hope this guide was helpful.  Enjoy your HDTV!