m (Bot: Automated text replacement (-Added On:.+\n?\n?\n?\n?\n? +)) |
m (→Properties: Fix .vbr) |
||
(12 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | ''' | + | {{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 identifier is also a part of the {{mIRC|playing music}} section. | |
− | ''' | ||
== Synopsis == | == Synopsis == | ||
− | <pre>$sound(<type | + | <pre>$sound(<type>)</pre> |
− | + | 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. | |
− | < | + | <pre>$sound(filename>)[.property]</pre> |
− | + | == 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. | |
− | <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>Returns ''$true'' or ''$false'' if variable bit rate is found. | ||
+ | : <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: | |
<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: | |
<source lang="mIRC">alias id3info { | <source lang="mIRC">alias id3info { | ||
Line 76: | Line 68: | ||
== Compatibility == | == Compatibility == | ||
− | + | {{mIRC compatibility|6.0}} | |
== See Also == | == See Also == | ||
− | * | + | * {{mIRC|playing music}} |
− | * | + | * {{mIRC|on midiend}} |
− | * | + | * {{mIRC|on mp3end}} |
− | * | + | * {{mIRC|on nosound}} |
− | * | + | * {{mIRC|on waveend}} |
* {{mIRC|$inmidi}} | * {{mIRC|$inmidi}} | ||
* {{mIRC|$insong}} | * {{mIRC|$insong}} | ||
Line 92: | Line 84: | ||
{{mIRC identifier list}} | {{mIRC identifier list}} | ||
− | [[Category: | + | [[Category:mIRC identifiers|sound]] |
Latest revision as of 19:06, 26 March 2024
$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 identifier is also a part of the playing music section.
Synopsis[edit]
$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[edit]
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.
- vbrReturns $true or $false if variable bit rate is found.
- 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[edit]
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[edit]
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.