Tuesday, December 16, 2008

How does Ipod Shuffle - shuffle?

OK A very simple question to all the regualr Ipod users out there-I've been constantly listening to songs on my Ipod for the past 1 month and put it on shuffle mode.

Question is: How does Ipod Shuffle shuffle the songs? Say something like all songs are considered as records in a file - then it does some sort of a sort and search mechanism to play my next song? (Bubble Sort and Binary Search?) (Hehehe Show Off!)

And If I hit the back button-it does go back to the last song it played-not some random song from the playlist...

my collegue told something about a Randomisation Algorithm and my head just reeled with the Information on Wikipedia on the subject! And IF there is something like an algorithm being used-then how does it become 'Random'? There will be some sort of a sequence to it then??

Can someone explain this in a simple way??

3 comments:

  1. Just easy. Use the rand() function in c (remember - everything has originated from c). write a rand function which finds number between 1-250 (once cud store up to 250 songs in the basic ipod shuffle). Use this function to select the next song to play in "shuffle" mode. Store the songs history to enable the "back" functionality.

    And, once this is achieved, send ur resume and the link to this blog to Steve Jobs for ur next job.

    ReplyDelete
  2. Oh My God! Nikhil-Why dont you do a post on this and explain to a Dud like me?

    Then shall we check with Steve Jobs? :-)

    ReplyDelete
  3. The way Ipod or media shuffle logic works is very simple. It will skip to the song you dont want to hear :o) you skip again and it will go to a lesser favorite song :o) finally you it will force you to search !

    ReplyDelete