<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Samuel Haddad &#187; Music</title> <atom:link href="http://samuelhaddad.com/tag/music/feed/" rel="self" type="application/rss+xml" /><link>http://samuelhaddad.com</link> <description></description> <lastBuildDate>Thu, 03 Nov 2011 16:32:38 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>C# .NET and LyricWiki to lookup lyrics</title><link>http://samuelhaddad.com/2009/03/22/c-net-and-lyricwiki-to-lookup-lyrics/</link> <comments>http://samuelhaddad.com/2009/03/22/c-net-and-lyricwiki-to-lookup-lyrics/#comments</comments> <pubDate>Mon, 23 Mar 2009 03:03:32 +0000</pubDate> <dc:creator>Samuel Haddad</dc:creator> <category><![CDATA[Desktop Enginnering]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[.NET]]></category> <category><![CDATA[C#]]></category> <category><![CDATA[LyricsWiki]]></category> <category><![CDATA[Music]]></category> <guid
isPermaLink="false">http://samuelhaddad.com/?p=204</guid> <description><![CDATA[Music is everywhere with today&#8217;s high speed internet is most home it is no wonder that music is even moving to the World Wide Web. Many radio stations allow you to stream their stations over the internet. Many websites have been developed around music, like www.jango.com, www.pandora.com, and www.last.fm. I recently released my second version [...]]]></description> <content:encoded><![CDATA[<p>Music is everywhere with today&#8217;s high speed internet is most home it is no wonder that music is even moving to the World Wide Web. Many radio stations allow you to stream their stations over the internet. Many websites have been developed around music, like <a
href="http://www.jango.com/">www.jango.com</a>, <a
href="http://www.pandora.com/">www.pandora.com</a>, and <a
href="http://www.last.fm/">www.last.fm</a>. I recently released my second version of <a
href="../../../../../software-projects/jango-desktop/">Jango Desktop</a> and one of the features I implemented was the ability to look up lyrics. Before I started I was thinking about all the ways I could parse the lyrics out of an existing lyric&#8217;s websites database. During my searching I stumbled upon <a
href="http://lyricwiki.org/">http://lyricwiki.org/</a>. Here is a small description of LyricWiki from the website:</p><p>LyricWiki is a free site which is a source where anyone can go to get reliable lyrics for any song, from any artist, without being hammered by invasive ads.</p><p>At this point you are probably thinking to yourself the same thing I did &#8220;Great, but where do I start?&#8221; So today I am writing a step by step tutorial on how to use Lyric wiki in your .NET program.</p><h2>Creating a simple lyric demo program:</h2><div
id="attachment_249" class="wp-caption alignnone" style="width: 666px"><img
class="size-full wp-image-249" title="Step 1 Create the Form" src="http://samuelhaddad.com/wp-content/uploads/2009/03/step11.jpg" alt="Step 1 Create the Form" width="656" height="370" /><p
class="wp-caption-text">Step 1: Create the Form</p></div><p>Open visual studio and setup your form to look similar to mine.</p><h3>Adding the web service:</h3><p>Because LyricWiki offers a web service, you will want to add it to your program as a web reference.   Right click on your solution and select add a web reference, or in .net 3.5 add a service reference -&gt; then go to advance and add a web reference. The service&#8217;s URL is <a
href="http://lyricwiki.org/server.php?wsdl">http://lyricwiki.org/server.php?wsdl</a> you will want to add it like below if you press go you should see the available methods.</p><div
id="attachment_251" class="wp-caption alignnone" style="width: 835px"><img
class="size-full wp-image-251" title="Adding a Web Reference" src="http://samuelhaddad.com/wp-content/uploads/2009/03/step21.jpg" alt="Adding a Web Reference" width="825" height="572" /><p
class="wp-caption-text">Adding a Web Reference</p></div><h3>Writing the code:</h3><p>Double click on your button on the form and let&#8217;s right some code to handle the lookup.</p><p>Add this to the top of your code:</p><pre class="brush: csharp; title: ; notranslate">
using LyricsLookup.org.lyricwiki;
</pre><p>Then add this to the button clicked method:</p><pre class="brush: csharp; title: ; notranslate">
private void LyricsButton_Click(object sender, EventArgs e)
{
LyricWiki wiki = new LyricWiki();
LyricsResult result;
string artist = artistTextBox.Text;
string song =   SongTextBox.Text;
if(wiki.checkSongExists(artist,song))
{
result = wiki.getSong(artist, song);
Encoding iso8859 = Encoding.GetEncoding(&quot;ISO-8859-1&quot;);
LyricsRichTextBox.Text = Encoding.UTF8.GetString(iso8859.GetBytes(result.lyrics));
}else{
StatusLabel.Text = &quot;Lyrics not found in database&quot;;
}
}
</pre><p>Then run and test.</p><p><a
href="http://samuelhaddad.com/wp-content/uploads/2009/03/LyricsLookup.zip">Download the full solution of LyricsLookup</a></p> ]]></content:encoded> <wfw:commentRss>http://samuelhaddad.com/2009/03/22/c-net-and-lyricwiki-to-lookup-lyrics/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> </channel> </rss>
