作者:Miliardo
注:该插件已收到KAGeXpress中,将随同新版本一起公开。
;------------------------------------------------------------
; Voice Replay Plugin for KAGeXpress 2/Infinity
;
; Author: Miliardo(Whitefang Studio)
;
;
http://whitefang.adn.cn/
; Copyright 2001-2006,Whitefang Studio & KEY FANS CLUB,All Rights Reserved
;------------------------------------------------------------
@iscript
tf.WSB=new WaveSoundBuffer(null);
tf.strs1="histvoice(\"";
tf.strs2="\")";
function histvoice(storage)
{
kag.se[0].stop();
if(!Storages.isExistentStorage(storage))
{
var test;
if(test = storage + ".wav", Storages.isExistentStorage(test))
storage = test;
else if(test = storage + ".ogg", Storages.isExistentStorage(test))
storage = test;
else if(test = storage + ".tcw", Storages.isExistentStorage(test))
storage = test;
else
throw new Exception("SE " + storage + " 未找到");
}
tf.WSB.open(storage);
tf.WSB.play();
}
@endscript
;语音播放(可以回放)
@macro name=lvoice
@eval exp="tf.WSB.stop()"
@playse storage=%file buf=0
@link clickse=%file clicksebuf=0 exp="tf.WSB.stop()"
@eval exp="tf.ds=tf.strs1+mp.file+tf.strs2"
@hact exp=&tf.ds
@endmacro
@macro name=lvend
@endlink
@endhact
@endmacro
@return
如果希望只在历史记录中回放的话请去掉:
@link clickse=%file clicksebuf=0 exp="tf.WSB.stop()"
和
@endlink
这两行。
因为原来是为KAGeXpress2写的,所以用的是kag.se[0](也就是SE的buffer0),如果你用其他的Buffer播放语音请修改:
kag.se[0].stop();
和
@playse storage=%file buf=0
@link clickse=%file clicksebuf=0 exp="tf.WSB.stop()"