mp3 information

By Saeed on Sep 26, 2007

Another simple code returning the information of your sepcifications of the current mp3. See the in-code comments for more info.

;;; mp3 information - Saeed * 2007 ;;;

/* 

About: Another one of my mp3 snippets on hawkee. It returns various information on the active mp3.

Usage: $tags(genre/album/title/size/frequency/bitrate/mode)

*/ 

alias tags { 
  if ($isid) && ($inmp3) { 
    if ($1 = genre) { 
      if (!$sound($insong).genre) return Unknown 
      else { return $sound($insong).genre }
    }
    if ($1 = album) { 
      if (!$sound($insong).album) return Unknown
      else { return $sound($insong).album }
    }
    if ($1 = title) { 
      if (!$sound($insong).title) return $remove($nopath($insong.fname),.mp3) 
      else { return $sound($insong.fname).title - $sound($insong.fname).artist }
    }
    if ($1 = size) return $bytes($file($insong.fname).size).suf
    if ($1 = frequency) return $+($round($calc($mp3($insong.fname).sample / 1000),1)),kHz) 
    if ($1 = bitrate) return $mp3($insong.fname).bitrate
    if ($1 = mode) return $mp3($insong.fname).mode
  } 
}

Comments

Sign in to comment.
Saeed   -  Oct 03, 2007

Thanks, fixing that right now.

 Respond  
KuTsuM   -  Oct 03, 2007

Just for cleaner code you should edit this
if ($isid) {
if ($inmp3) {
to
if ($isid) && ($inmp3) {

Just because you have no use for them to be seperated. Otherwise, good job :)

 Respond  
guest598594   -  Sep 26, 2007

these can come in handy with all those mp3 scripts

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.