mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Im having hard time getting the lenght of the song so i can create a Repeat script when the song is done etc..

basically the syntax i see is $sound(filename).lenght

or $insong.lenght

$sound($insong.fname).lenght

doesnt work..

here is a short form of the dialog I have not added the scroll bar yet for the volume and the script is not done but basically the DIR is usable.

Error I get is saying * /echo: insufficient parameters when i do a simple echo test

I know I can create this script once lenght works with $insong.pos to find out when the song is done etc...

just lenght wont work

here is the dialog so far... like i said im not done with the scripts



Code:
dialog Mp3Diag {
  title "Mp3Diag"
  size -1 -1 149 89
  option dbu
  box "Vol", 2, 123 2 20 71
  list 3, 4 10 114 45, size hsbar vsbar
  button "|>", 4, 55 58 16 12
  button "[ ]", 5, 79 58 16 12
  button "| |>", 6, 102 58 16 12
  button "| |", 7, 29 58 16 12
  button "<| |", 8, 4 58 16 12
  box "Mp3 List", 9, 1 2 120 71
  radio "Rpt", 10, 2 76 21 10
  radio "Rdm", 11, 21 76 23 10
  button "[Dir Sel]", 12, 44 75 24 12
  button "[Single]", 13, 69 75 24 12
  button "[Clear]", 14, 94 75 24 12
  button "[Adver]", 15, 119 75 24 12
  text "65535", 21, 125 38 16 8, center
  button "+", 1, 127 12 12 12
  button "-", 22, 127 55 12 12
  menu "File", 16
  item "Close", 17, 16, ok
  menu "Advertise", 18
  item "Current Chan", 19, 18
  item "All Chan", 20, 18
}

on *:DIALOG:Mp3diag:INIT:0:{
  did -ra $dname 21 $vol(master)
}

on *:DIALOG:mp3diag:sclick:1:{
  vol -v $calc(2000 + $vol(master))
  did -ra $dname 21 $vol(master)
}

on *:DIALOG:mp3diag:dclick:3:{
  if (%mp3.ad == on) { splay %mp3.a $+ $did($dname,3).seltext
    msg %mp3.chan 12,1.::8,1Mp3p12,1::. 8,1Artist: < $+ $sound($insong.fname).artist $+ > 8,1Title: < $+ $sound($insong.fname).title $+ > 8,1Vol: < $+ $calc($vol(master) / 654 + .09 + 0.01) $+ % $+ > 8,1Mode: < $+ $sound($insong.fname).mode $+ > 
  }
  elseif (%mp3.ad != on) { splay %mp3.a $+ $did($dname,3).seltext }
}

on *:DIALOG:mp3diag:sclick:5:{
  splay stop
}

on *:DIALOG:mp3diag:sclick:12:{
  var %mp3.a = $sdir(D:\)
  var %b = 1
  while (%b <= $findfile(%mp3.a,*.mp3,0)) {
    did -a $dname 3 $remove($findfile(%mp3.a,*.mp3,%b),%mp3.a)
    inc %b
  }
}

on *:DIALOG:mp3diag:menu:19:{
  %mp3.ad = on
  %mp3.chan = $active
}

on *:DIALOG:mp3diag:menu:20:{
  %mp3.ad = on
}

on *:DIALOG:mp3diag:sclick:22:{
  vol -v $calc($vol(master) - 2000)
  did -ra $dname 21 $vol(master)
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
instead of length you might use on mp3end

on *:mp3end:{
if ($dialog(basicmp3player) == $null) { return }
if ($did(basicmp3player,700).state != 1) { return }
.timerrandmp3 1 10 randplaymp3
}
alias randplaymp3 {
var %basicmp3playererlines = $did(basicmp3player,100).lines
did -c basicmp3player 100 $r(1,%basicmp3playererlines)
splay $did(basicmp3player,100).seltext
$iif($did(basicmp3player,600).state,showmp3stuff)
}
clipped from a mp3 player i did some time back

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Using MP3END as MikeChat suggested would be easier than trying to use timers or anything like that.

As for why you can't get the length of a song.. Since you misspelled "length" as "lenght" throughout your whole post, you probably did the same thing in your code.

-genius_at_work


Link Copied to Clipboard