Archive

Posts Tagged ‘projects’

Pulling metadata out of enhanced podcasts (.m4a) and into XML

August 13th, 2009 pj4533 2 comments

puzzle_pieces300x199

For my radio show iPhone application project, I wanted to use the metadata contained in my enhanced podcast files. Including:

  • chapter information (artist/song)
  • chapter start time
  • chapter image

Once I had this information I wanted to store it in XML on my server so I could access it whenever I wanted (from the iPhone application).

Read more…

Streaming Audio To the iPhone Starting At An Offset

August 1st, 2009 pj4533 12 comments

Starting with Matt Gallagher’s awesome AudioStreamer class, I wanted to extend it in a couple ways:

  1. Be able to play my radio show .mp3s hosted on my website (static files, not streams)
  2. Be able to start playback at any point in the file (startWithOffsetInSecs)
  3. Obviously, have it work on the iPhone
  4. Be able to have full control of audio & drawing while audio is playing

Actually, #3 & #4 are really what pushed me to find Matt’s class in the first place…so they aren’t really extensions of AudioStreamer, but rather why I chose to use AudioStreamer in the first place. The other major option was using something like MPMoviePlayerController. But that had several limitations which I won’t get into here.
Read more…

Say Goodnight Software: ceeFrenzy v1.0

July 22nd, 2009 pj4533 No comments

Submitted my first iPhone application to the app store for approval last night! Hopefully it will be approved soon! Its fairly simple, but functional…but for a very very targeted audience. Contact me if you have any problems or comments!

Description:

ceeFrenzy is a dedicated iPhone/iPod touch version of the website CollectorsFrenzy.com, developed jointly by Collectors Frenzy and Say Goodnight Software.

From the website:

Collectors Frenzy is a record price guide for collectors and dealers to get a general idea of how much an LP is worth. The price of LPs are constantly fluctuating due to supply and demand, so as buyers and sellers it can be difficult to determine whether you are over paying or under selling your records. Collectors Frenzy is a record price guide to help you obtain fair market value for your LPs.

How does Collectors Frenzy work? It gathers completed auction data off of E-Bay on a regular basis giving you the most accurate and up to date prices on LPs.

To retrieve this data simply type in an artist name, album title, etc into the search bar. To sort the data simply click on one of the search type buttons and select the method of sorting you prefer (ascending or descending).

Writing a twitter client in C#

April 28th, 2009 pj4533 No comments

I have a radio show at WMFO, at Tufts University. Its a community/college radio station, and completely freeform! For those interested, you can check my radio show website galacticfractures.com, for downloadable shows and whatnot.

At any rate, I wanted to be able to tweet songs as I played them, including a link to our online stream, so people could easily tune in. I did it by hand for a few weeks (on facebook), but it got to be a pain because we already type in songs into a website called Spinitron.com. Effectively I was typing in songs twice, while I was attempting to dj!

I did some digging around and Spinitron publishes a few RSS feeds for each station it supports. One of the feeds is based on the ‘current’ playlist, so it made it very easy to figure out the most recently entered song. See here:

   private void UpdateFromSpinitron()   {       XmlDocument doc = new XmlDocument();

       HttpWebRequest request = WebRequest.Create(SpinitronRSSUrl) as HttpWebRequest;

       String currentPlaying = "";       using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)       {           StreamReader reader = new StreamReader(response.GetResponseStream());           doc.Load(reader);           XmlNodeList nodelist = doc.SelectNodes("/rss/channel/item");           XmlNode currentPlayingNode = nodelist[0].SelectSingleNode("title");

           currentPlaying = currentPlayingNode.InnerText;           currentPlaying = currentPlaying.Replace(":"," -");           currentPlaying = currentPlaying.Replace("'", "");       }       tweetMsg.Text = "Now Playing: " + currentPlaying + "  (Listen Live @ WMFO.org: http://bit.ly/lOAWA)";   }

Unfortunately, Spinitron’s XML feed is craaaaaaaaap. The “description” node contains ALL the information?!?! Why use XML at all then!? Spread them nodes out, man! Anyway, I was only interested in the artist and title (which are both in the “title” node, ugg).

From there, I just threw it on a 10 second timer to query the XML feed for the latest track. I didn’t want it to automatically tweet the song, however, cause I think that could get noisy and be rude to your followers. I instead put a button for tweeting of the song. Maybe you do only every few songs? Whatever…enough to keep people interested.

Lastly, I borrow some code for sending the tweet…but it was real simple. Basically just opening a connection to the twitter url and sending it on! They make it real simple to send tweets, I didn’t even have to mess with the twitter API or anything.

I put the project up on codeplex here: http://spinitweet.codeplex.com/

EDIT: It occured to me that I wasn’t quite clear on my comments regarding Spinitrons XML feeds. I think I understand why they didn’t break it up beyond Title/Description. Obviously they were fitting RSS. However, why even make XML for this? Noone would read a RSS feed of that in Google Reader, for example. It would make more sense to do a RSS feed of a given users shows, and have the description be the nicely formatted complete playlist. Spinitron even says:

“An RSS feed for an individual playlist isn’t really in the spirit of RSS
because, unless it happens to be the current playlist, it’s not likely to change
like news or blog feeds do. But it may be useful to someone using a script to
grab the playlist data and process it because RSS XML should be easier to parse
than HTML playlist pages.”

So if the point is to allow people to parse the playlists, don’t worry about RSS, and just give me a better broken down XML file!

MemSpyy

April 27th, 2009 pj4533 4 comments

memspyy

Recently over at If broken it is, fix it you should, Tess Ferrandez posted about a cool memory application that uses output gathered from windbg to show you information graphically. I have written a similar application a few months back, and thought I would scrub it, and share the source. I originally used VisualStudio 2003, but loaded it into 2008, and verified it all builds & runs. I did get a bunch of warnings.

The most interesting thing about this application is that it uses some DLLInjection code from Robert Kuster to run some heap walking code inside the process being viewed. This is the code in question:

MEMORYSTATUSEX statex;statex.dwLength = sizeof (statex);

GlobalMemoryStatusEx (&statex);

g_UncommittedSize = statex.ullAvailVirtual;

PROCESS_HEAP_ENTRY heapEntry;memset(&heapEntry,0,sizeof(heapEntry));

while(HeapWalk(GetProcessHeap(), &heapEntry))     g_UncommittedSize += heapEntry.cbData;        

Fairly straightforward code, but I can’t figure out how to get that information out of proc.

I thought this would be a good chance to try out CodePlex as well, so I uploaded the source there. CodePlex is pretty nice, basically very similar to GoogleCode and other sites. I was initially excited to try out some VisualStudio integration, but I couldn’t get it to install properly, and got frustrated. I ended up just using TortoiseSVN.

MemSpyy on CodePlex