mIRC Scripting

mIRC: Playing Music

Sound Options

By this point, you should have a decent knowledge of making dialogs and aliases. mIRC offers a great way to play your favorite music right off the mIRC client. With great dialog skills, a nice player can be made.

In order for you to be able to play music sounds must be enabled. You can do so by going to the option dialog (Alt+O) -> Sounds -> <check> Enable sounds.

Playing Music

/splay -cwmpq [filename | stop | pause | resume | seek | skip] [pos]

This command gives you basic control over playing music.

  • w - wave files
  • m - midi files
  • p - MP3 files

Supported Files: .wma, .mp3, .wav, .mid, and .ogg

To simply play the sound you would use:

/splay MySong.MP3

If the file is not in the mIRC directory, a full file path is required (quotes are not needed).

/splay C:\My Music\Nickelback\Rockstar.mp3

The [pos] optional parameter is used to point out the location. for example if you want to start a music file at a specific spot you would use

/splay C:\My Music\Nickelback\Rockstar.mp3 1500

Music Is Playing, What Now?

After the music is playing you have a few options on what to do with it. If you are making a full Music Player in a dialog form this options are really helpful.

Pause - you can use /splay pause to pause the playing music
Resume - by using /splay resume you can resume the paused music.
Stop - by using /splay stop you can stop the playing music.
Seek - is used to go to a certain point in the music using: /splay seek 1000
Skip - by using /splay stop you can stop the playing music.

Using -w -m -p - you can use the file type switches to control only specific kinds of files, for example /splay -w stop will stop only wave files.

Volume

mIRC allows you to change the volume of the master control as well as other types of media.

/vol -wmpvuN [volume]

volume - is a numeric value between 0 and 65535, where 65535 is the loudest and 0 is the quietest.

  • -w - change the Wave volume
  • -m - change the midis volume
  • -p - change the mps volume
  • -v - Master Volume
  • -uN - sets mute n=0 - Mute n=1 - UnMute

 

Identifiers

$vol(wave | midi | song | master)[.mute]

This will give you the volume setting. If the property "mute" is used it will return the mute setting for the volume type.

Volume Control Example:

;//To Use The Volume Script Just Right Click
;//Anywhere on the channel (Except the users lol)
;//and you will see the Volume Menu

Menu Channel {
  Volume
    .25%: vol -v 16384
    .50%: vol -v 32768
    .75%: vol -v 49152
    .100%: vol -v 65535
    .Custom: Volume
}
Alias Volume {
  dialog -m Volume Volume
  did -c volume 2 $vol(Master)
}
Dialog Volume {
  title "Volume Adjuster"
  size -1 -1 100 45
  option dbu
  text "Adjust Your Volume As Needed:",1, 4 4 80 15
  scroll "",2,4 10 90 10, horizontal range 65535
  text "Volume:",3, 4 22 18 15
  text $vol(Master),4, 30 22 18 8
  button "&Ok", 5, 30 30 40 12, OK
}
ON 1:dialog:Volume:scroll:2: {
  did -a volume 4 $did(2).sel
  vol -v $did(2).sel
}

General Identifiers

$inwave()[.fname, pos, length, pause]
$inmidi()[.fname, pos, length, pause]
$insong()[.fname, pos, length, pause]

Boolean Data Type - $true is sound type is playing, otherwise, $false

$sound(type)

Returns the directory specified in the Sound Requests (Options dialog)
type - can be wave, ogg, midi, mp3, or wma

$sound(filename)[.propery]

Returns either the directory for that file type (like as said above).

If the file is an MP3 the following properties are optional:

Properties (.MP3 only):

album, title, artist, year, comment, genre, track, length, version, bitrate, vbr, sample, mode, copyright, private, crc, id3, tag, tag