mIRC Home    About    Download    Register    News    Help

Print Thread
#177167 20/05/07 11:47 PM
Joined: May 2007
Posts: 1
D
DaFlo Offline OP
Mostly harmless
OP Offline
Mostly harmless
D
Joined: May 2007
Posts: 1
GOod Evening, i want to simulate a kind of SC Server via mIRC. winamp is connection on the server and i can play the first song without errors. But if i want to play the second song, WinAMP means i have a buffering.

Heres the Code:

On *:SOCKLISTEN:sc: {
/sockaccept scs
}
On *:SOCKACCEPT:scs: {

}
On *:SOCKWRITE:scs: {
if ( %b == 1 ) {
inc %i 4096
bread %file %i 4096 &kot
if ( $calc($file( %file ).size - %i) > 4096 ) {
/sockwrite -b scs 4096 &kot
}

else {
/sockwrite -b scs $calc($file( %file ).size - %i) &kot
}
}
if ( %i > $file( %file ).size ) { set %b 0 }
}

On *:SOCKREAD:scs: {
sockread %temp
echo -a %temp
if ( GET isin %temp ) {
echo -a br
set %b 1
sockwrite -n scs ICY 200 OK
sockwrite -n scs icy-name:mIRC Streaming ( %file )
sockwrite -n scs icy-url:http://www.shoutcast.com
sockwrite -n scs icy-genre:MircScriptingLanguage
/set %i 0
/bread %file %i 4096 &kot
/sockwrite -b scs 4096 &kot
inc %i 4096


}
}

alias starts {
/set %i 0
/set %file $shortfn($1-)
/bread %file %i 4096 &kot
/sockwrite -b scs 4096 &kot
inc %i 4096
}





%file contains the $shortfn() path of the file
I want to start a new file by entering
/starts <filename>

Please help me frown

Last edited by DaFlo; 20/05/07 11:48 PM.
DaFlo #177169 20/05/07 11:51 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I can't help you with the code, as you're using socket and binary variables, both of which I'm very unfamiliar with, however, in future (and if it's not too late for you to edit your code), please include Code Tags around your code. In this forum, the # button at the top of this area is for the Code Tags.

DaFlo #177727 30/05/07 06:19 AM
Joined: May 2003
Posts: 32
Q
Ameglian cow
Offline
Ameglian cow
Q
Joined: May 2003
Posts: 32
as I know- the SC protocol requires some info between songs.
I mean- the SC server indicates to winamp that the song is over, and it is sending a new song.
a lot of time ago, i made the same thing, and it worked.
anyway- find the exact protocol, and good luck.


Link Copied to Clipboard