$sound

From Scriptwiki
Revision as of 20:03, 5 October 2008 by Aca20031 (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
$sound(wave|midi|mp3|wma|ogg)

Returns the directory for the specified sound files as specified in the Sound Requests dialog.

$sound(filename)[.album|.title|.artist|.year|.comment|.genre|.track|.length|.version|.bitrate|.vbr|.sample|.mode|.copyright|.private|.crc|.id3|.tag|.tags]

Returns information on the specified .mp3 file

  • Paramaters
    • Filename - The file to check. This can be relative to $mircdir or an absolute path, for example "C:\My Folder\My File.mp3")
  • Properties
    • The following properties return the id3v1 tag values for the specified mp3 file
      • .album - returns the album associated with the mp3.
      • .title - returns the title of the mp3 sound.
      • .artist - returns the album artist of the mp3 sound.
      • .year - returns the year the mp3 sound was published.
      • .comment - returns the comment associated with the mp3.
      • .genre - returns the genre of the mp3 sound.
      • .track - returns the track number of the mp3 sound (it's track on .album).
      • .length - returns the length of the track in milliseconds(see $calc and $duration to convert).
      • .version - returns the version associated with the mp3.
      • .bitrate - returns the bitrate of the mp3 in kbits/second.
      • .vbr - returns $true if the mp3 has a variable bit rate, otherwise $false
      • .sample - returns the sample rate of the mp3 in hertz
      • .mode - returns the mode of the mp3, for example, "Stereo" or "Mono"
      • .copyright - returns $true if there is associated copyright information, otherwise $false
      • .private - returns $true if the mp3 is marked private, otherwise $false
      • .crc - returns $true if CRC protection is available, $false otherwise
      • .id3 - returns the version of id3 supported by this mp3
    • The following properties return the id3v2 tag values for the specified mp3 file
      • .tags - returns a list of id3v2 tags for this file
      • . tag - returns the Nth id3v2 tag for this file. For example: $sound(test.mp3,2).tag return the 2nd id3v2 tag listed in $sound(test.mp3).tags

Examples

echo -atg $sound(test.mp3).title

This would echo the id3v1 title of the file

echo -atg $sound(test.mp3,$findtok($sound(test.mp3).tags,TIT2,1,32)).tag

This would search for the tag number of TIT2, and return that tag for test.mp3. Therefore, echoing the id3v2 title

echo -atg $sound(test.mp3,0).tags

This would echo a list of id3v2 tags for the mp3

See Also