From WikiChip
Difference between revisions of "mirc/identifiers/$sound"
< mirc‎ | identifiers

(Properties)
m
Line 1: Line 1:
{{mirc title|$sound Identifier}}'''Note:''' This command is also a part of the [[Playing music - mIRC|playing music]] section.
+
{{mirc title|$sound identifier}}'''$sound''' is a powerful identifier that can be used to retrieve various information about sound files, including: directories which contain specific sounds file types, as well as [[ID3 tags]] associated with sound files which support them.
  
 
+
'''Note:''' This command is also a part of the {{mIRC|playing music}} section.
'''$sound''' is a powerful identifier that can be used to retrieve various information about sound files, including: directories which contain specific sounds file types, as well as [[ID3 tags]] associated with sound files which support them.
 
  
 
== Synopsis ==
 
== Synopsis ==
 
<pre>$sound(<type>)</pre>
 
<pre>$sound(<type>)</pre>
  
Possible value for <type>
+
Possible value for <type>:
 
 
 
* mp3 - Return the mp3 folder
 
* mp3 - Return the mp3 folder
 
* midi - Return the midi folder
 
* midi - Return the midi folder
 
* wave - Return the wave folder
 
* wave - Return the wave folder
  
$sound itself returns the default folder for music in general.
+
$sound without parameters returns the default folder for music in general.
 
 
  
 
<pre>$sound(filename>)[.property]</pre>
 
<pre>$sound(filename>)[.property]</pre>
  
 
== Properties ==
 
== Properties ==
 
 
If used with a music filename, the following properties are available:
 
If used with a music filename, the following properties are available:
  
''Note:'' Only mp3, ogg, and wma files currently support the following properties. Keep in mind that not all properties may have been set. Each property returns the Id3v1 values. For id3v2, use the ''.tag'', and ''.tags'' properties.
+
'''Note:''' Only mp3, ogg, and wma files currently support the following properties. Keep in mind that not all properties may have been set. Each property returns the Id3v1 values. For id3v2, use the ''.tag'', and ''.tags'' properties.
 
 
<span style="display: inline-block; width: 110px;">'''album'''</span>Retrieves the specified album name sound file.
 
 
 
<span style="display: inline-block; width: 110px;">'''title'''</span>Returns the song title for the file.
 
 
 
<span style="display: inline-block; width: 110px;">'''artist'''</span>Returns the artist name for the file.
 
 
 
<span style="display: inline-block; width: 110px;">'''year'''</span>Returns the year associated with the song release.
 
 
 
<span style="display: inline-block; width: 110px;">'''comment'''</span>Returns any comments made by the file creator.
 
 
 
<span style="display: inline-block; width: 110px;">'''genre'''</span>Grabs the genre for the file, if set.
 
 
 
<span style="display: inline-block; width: 110px;">'''track'''</span>Retrieves the track number associated with the song.
 
 
 
<span style="display: inline-block; width: 110px;">'''length'''</span>Returns the full length of the song in milliseconds.
 
 
 
<span style="display: inline-block; width: 110px;">'''version'''</span>Gets the version number of the song, or track.
 
 
 
<span style="display: inline-block; width: 110px;">'''bitrate'''</span>Returns the [[bitrate]] for the file.
 
 
 
<span style="display: inline-block; width: 110px;">'''vbr'''</span>Gets the [[variable bit rate]] for the file.
 
 
 
<span style="display: inline-block; width: 110px;">'''sample'''</span>Returns the [[sampling frequency]].
 
 
 
<span style="display: inline-block; width: 110px;">'''mode'''</span>Returns the mode: ''mono'', ''stereo'', etc.
 
 
 
<span style="display: inline-block; width: 110px;">'''copyright'''</span>Returns any copyright information.
 
 
 
<span style="display: inline-block; width: 110px;">'''private'''</span>Returns ''$true'' or ''$false'' for the private tag.
 
 
 
<span style="display: inline-block; width: 110px;">'''crc'''</span>Returns ''$true'' or ''$false'' if crc is found.
 
 
 
<span style="display: inline-block; width: 110px;">'''.id3'''</span>Returns the [[id3]] tag information.
 
 
 
<span style="display: inline-block; width: 110px;">'''.tag'''</span>Used to retrieve [[id3v2]] information.
 
  
<span style="display: inline-block; width: 110px;">'''.tags'''</span>Used to retrieve [[id3v2]] information.
+
: <span style="display: inline-block; width: 110px;">'''album'''</span>Retrieves the specified album name sound file.
 +
: <span style="display: inline-block; width: 110px;">'''title'''</span>Returns the song title for the file.
 +
: <span style="display: inline-block; width: 110px;">'''artist'''</span>Returns the artist name for the file.
 +
: <span style="display: inline-block; width: 110px;">'''year'''</span>Returns the year associated with the song release.
 +
: <span style="display: inline-block; width: 110px;">'''comment'''</span>Returns any comments made by the file creator.
 +
: <span style="display: inline-block; width: 110px;">'''genre'''</span>Grabs the genre for the file, if set.
 +
: <span style="display: inline-block; width: 110px;">'''track'''</span>Retrieves the track number associated with the song.
 +
: <span style="display: inline-block; width: 110px;">'''length'''</span>Returns the full length of the song in milliseconds.
 +
: <span style="display: inline-block; width: 110px;">'''version'''</span>Gets the version number of the song, or track.
 +
: <span style="display: inline-block; width: 110px;">'''bitrate'''</span>Returns the [[bitrate]] for the file.
 +
: <span style="display: inline-block; width: 110px;">'''vbr'''</span>Gets the [[variable bit rate]] for the file.
 +
: <span style="display: inline-block; width: 110px;">'''sample'''</span>Returns the [[sampling frequency]].
 +
: <span style="display: inline-block; width: 110px;">'''mode'''</span>Returns the mode: ''mono'', ''stereo'', etc.
 +
: <span style="display: inline-block; width: 110px;">'''copyright'''</span>Returns any copyright information.
 +
: <span style="display: inline-block; width: 110px;">'''private'''</span>Returns ''$true'' or ''$false'' for the private tag.
 +
: <span style="display: inline-block; width: 110px;">'''crc'''</span>Returns ''$true'' or ''$false'' if crc is found.
 +
: <span style="display: inline-block; width: 110px;">'''.id3'''</span>Returns the [[id3]] tag information.
 +
: <span style="display: inline-block; width: 110px;">'''.tag'''</span>Used to retrieve [[id3v2]] information.
 +
: <span style="display: inline-block; width: 110px;">'''.tags'''</span>Used to retrieve [[id3v2]] information.
  
 
== Examples ==
 
== Examples ==
'''Echo the artist name of the currently playing mp3 file to the active window'''
+
Echo the artist name of the currently playing mp3 file to the active window:
 
<source lang="mIRC">//echo -a $sound($insong.fname).artist</source>
 
<source lang="mIRC">//echo -a $sound($insong.fname).artist</source>
  
'''Create a small alias that will open a window, @id3info, and echo some basic info about the currently playing song to it'''
+
Create a small alias that will open a window, @id3info, and echo some basic info about the currently playing song to it:
 
<source lang="mIRC">alias id3info {
 
<source lang="mIRC">alias id3info {
  
Line 93: Line 71:
  
 
== See Also ==
 
== See Also ==
* [[Playing Music - mIRC|Playing Music]]
+
* {{mIRC|playing music}}
* [[On midiend - mIRC|ON MIDIEND]]
+
* {{mIRC|on midiend}}
* [[On mp3end - mIRC|ON MP3END]]
+
* {{mIRC|on mp3end}}
* [[On nosound - mIRC|ON NOSOUND]]
+
* {{mIRC|on nosound}}
* [[On waveend - mIRC|ON WAVEEND]]
+
* {{mIRC|on wavened}}
 
* {{mIRC|$inmidi}}
 
* {{mIRC|$inmidi}}
 
* {{mIRC|$insong}}
 
* {{mIRC|$insong}}
Line 106: Line 84:
 
{{mIRC identifier list}}
 
{{mIRC identifier list}}
  
[[Category:MIRC identifiers]]
+
[[Category:mIRC identifiers|sound]]

Revision as of 15:33, 22 September 2017

$sound is a powerful identifier that can be used to retrieve various information about sound files, including: directories which contain specific sounds file types, as well as ID3 tags associated with sound files which support them.

Note: This command is also a part of the playing music section.

Synopsis

$sound(<type>)

Possible value for <type>:

  • mp3 - Return the mp3 folder
  • midi - Return the midi folder
  • wave - Return the wave folder

$sound without parameters returns the default folder for music in general.

$sound(filename>)[.property]

Properties

If used with a music filename, the following properties are available:

Note: Only mp3, ogg, and wma files currently support the following properties. Keep in mind that not all properties may have been set. Each property returns the Id3v1 values. For id3v2, use the .tag, and .tags properties.

albumRetrieves the specified album name sound file.
titleReturns the song title for the file.
artistReturns the artist name for the file.
yearReturns the year associated with the song release.
commentReturns any comments made by the file creator.
genreGrabs the genre for the file, if set.
trackRetrieves the track number associated with the song.
lengthReturns the full length of the song in milliseconds.
versionGets the version number of the song, or track.
bitrateReturns the bitrate for the file.
vbrGets the variable bit rate for the file.
sampleReturns the sampling frequency.
modeReturns the mode: mono, stereo, etc.
copyrightReturns any copyright information.
privateReturns $true or $false for the private tag.
crcReturns $true or $false if crc is found.
.id3Returns the id3 tag information.
.tagUsed to retrieve id3v2 information.
.tagsUsed to retrieve id3v2 information.

Examples

Echo the artist name of the currently playing mp3 file to the active window:

//echo -a $sound($insong.fname).artist

Create a small alias that will open a window, @id3info, and echo some basic info about the currently playing song to it:

alias id3info {
 
  ; First, we check to make sure we currently have an mp3, ogg, or wma file playing
  if ($insong) {
 
    ; If the @id3info window is open, clear it, otherwise create it.
    $iif($window(@id3info),clear @id3info,window @id3info)
 
    echo @id3info Artist: $sound($insong.fname).artist
    echo @id3info Track: $sound($insong.fname).track
    echo @id3info Title: $sound($insong.fname).title
    echo @id3info Album: $sound($insong.fname).album
 
    ; The below calculation converts the milliseconds for the sound
    ; file length into the format mm:ss, or minutes:seconds. Note that
    ; this does not properly support lengths over 59 minutes and 59
    ; seconds long.
    echo @id3info Length: $replace($round($calc($sound($insong.fname).length / 1000 / 60),2),.,:)
    echo @id3info Year: $sound($insong.fname).year
  }
}

Compatibility

Added: mIRC v6.0
Added on: 03 Feb 2002
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also

v · d · e mIRC identifier list

$ $$, $, $0, $1-, $!, $&, $*, $+, $++, $?

A $abook, $abs, $acos, $active, $activecid, $activewid, $adate, $address, $addtok, $addtokcs, $agent, $agentname, $agentstat, $agentver, $alias, $and, $anick, $ansi2mirc, $aop, $appactive, $appstate, $asc, $asctime, $asin, $atan, $atan2, $auto, $avoice, $away, $awaymsg, $awaytime

B $banlist, $banmask, $base, $beta, $bfind, $bindip, $bitoff, $biton, $bits, $bnick, $bvar, $bytes

C $calc, $caller, $cancel, $cb, $cd, $ceil, $chan, $chanmodes, $channel, $chantypes, $chat, $chr, $cid, $clevel, $click, $cmdbox, $cmdline, $cnick, $color, $colour, $com, $comcall, $comchan, $comchar, $comerr, $compact, $compress, $comval, $cos, $cosh, $count, $countcs, $cr, $crc, $creq, $crlf, $ctime, $ctimer, $ctrlenter

D $date, $day, $daylight, $dbuh, $dbuw, $dccignore, $dccport, $dde, $ddename, $debug, $decode, $decompress, $deltok, $devent, $dialog, $did, $didreg, $didtok, $didwm, $dir, $disk, $dlevel, $dll, $dllcall, $dname, $dns, $donotdisturb, $dqwindow, $duration

E $ebeeps, $editbox, $email, $emailaddr, $encode, $envvar, $error, $eval, $evalnext, $event, $eventid, $eventparms, $exists, $exiting

F $false, $feof, $ferr, $fgetc, $file, $filename, $filtered, $find, $finddir, $finddirn, $findfile, $findfilen, $findtok, $findtokcs, $fline, $flinen, $floor, $font, $fopen, $fread, $fromeditbox, $fserv, $fserve, $fulladdress, $fulldate, $fullname, $fullscreen

G $get, $getdir, $getdot, $gettok, $gmt, $group

H $halted, $hash, $height, $hfile, $hfind, $hget, $highlight, $hmac $hmatch, $hnick, $host, $hotline, $hotlinepos, $hotlink, $hotp, $hregex, $hypot

I $iaddress, $ial, $ialchan, $ibl, $idle, $iel, $ifmatch, $ifmatch2, $ignore, $iif, $iil, $inellipse, $ini, $initopic, $inmidi, $inmode, $inmp3, $inpaste, $inpoly, $input, $inrect, $inroundrect, $insong, $insongpause, $instok, $int, $intersect, $inwave, $inwho, $ip, $iptype, $iql, $isadmin, $isalias, $isbit, $isdde, $isdir, $isfile, $isid, $islower, $istok, $istokcs, $isupper, $isutf

K $keychar, $keyrpt, $keyval, $knick

L $lactive, $lactivecid, $lactivewid, $left, $leftwin, $leftwincid, $leftwinwid, $len, $level, $lf, $line, $lines, $link, $lock, $locked, $lof, $log, $log10, $logdir, $logstamp, $logstampfmt, $longfn, $longip, $lower, $ltimer

M $maddress, $mask, $matchkey, $matchtok, $matchtokcs, $maxlenl, $maxlenm, $maxlens, $md5, $me, $menu, $menubar, $menucontext, $menutype, $mid, $mididir, $mircdir, $mircexe, $mircini, $mkfn, $mklogfn, $mknickfn, $mnick, $mode, $modefirst, $modelast, $modespl, $mouse, $mousecx, $mousecy, $mousedx, $mousedy, $mousekey, $mouselb, $mousex, $mousey, $mousewin, $mp3, $mp3dir, $msfile, $msgstamp, $msgtags

N $N, $naddress, $network, $newnick, $nhnick, $nick, $nickmode, $no, $nofile, $nopath, $nopnick, $noqt, $not, $notags, $notify, $null, $numeric, $numtok, $nvnick

O $ok, $online, $onlineserver, $onlinetotal $onpoly, $opnick, $or, $ord, $os

P $parmN, $parms, $parseline, $parsetype, $parseutf, $passivedcc, $pi, $pic, $play, $pnick, $portable, $portfree, $pos, $poscs, $prefix, $prop, $protect, $puttok

Q $qt, $query

R $r, $raddress, $rand, $rands, $rawbytes, $rawmsg, $read, $readini, $readn, $regbr, $regerrstr, $regex, $regml, $regmlex, $regsub, $regsubex, $remote, $remove, $removecs, $remtok, $remtokcs, $replace, $replacecs, $replacex, $replacexcs, $reptok, $reptokcs, $result, $rgb, $right, $rnick, $round

S $samepath, $scid, $scon, $script, $scriptdir, $scriptline, $sdir, $send, $server, $serverip, $servertarget, $sfile, $sha1, $sha256, $sha384, $sha512, $shortfn, $show, $signal, $sin, $sinh, $site, $sline, $snick, $snicks, $snotify, $sock, $sockbr, $sockerr, $sockname, $sorttok, $sorttokcs, $sound, $speak, $sqrt, $sreq, $ssl, $sslcertsha1, $sslcertsha256, $sslcertvalid, $ssldll, $ssllibdll, $sslready, $sslversion, $starting, $status, $str, $strip, $stripped, $style, $submenu, $switchbar, $sysdir

T $tan, $tanh, $target, $tempfn, $ticks, $time, $timeout, $timer, $timestamp, $timestampfmt, $timezone, $tip, $tips, $titlebar, $token, $toolbar, $topic, $totp, $treebar, $true, $trust

U $ulevel, $ulist, $unsafe, $upper, $uptime, $url, $usermode, $utfdecode, $utfencode

V $v1, $v2, $var, $vc, $vcmd, $vcmdstat, $vcmdver, $version, $vnick, $vol

W $wavedir, $wid, $width, $wildsite, $wildtok, $wildtokcs, $window, $wrap

X $xor

Y $yes

Z $zip

= =$nick