voice problem

05/27/2013 02:34 LordGragen.#1
so i was going over my voice codes and, i found a bit problem with it,

when i click on my npc it start talking, and while its talking i also clicked on another npc they both started talking which was annoying,

now is it possible to make when 1 is talking and if i click on another one it should cancelled the first one.

Code:
 _String _string = new _String(true);
                                    _string.UID = client.Entity.UID;
                                    _string.TextsCount = 2;
                                    _string.Type = _String.Sound;
                                    _string.Texts.Add("voice/NPC_10081.wav");
                                    _string.Texts.Add("1");
                                    client.Send(_string);

Code:
  public byte[] ToArray()
        {
            ushort entirelength = 19;
            foreach (string list in Texts)
                entirelength += (ushort)(list.Length + 1);
            byte[] buffer = new byte[entirelength];
            WriteUInt16((ushort)(entirelength - 8), 0, buffer);
            WriteUInt16(1015, 2, buffer);
            WriteUInt32(UID, 4, buffer);
            buffer[8] = Type;
            Buffer = buffer;
            WriteStringList(Texts, 9, Buffer);
            return Buffer;
        }
05/27/2013 03:26 CptSky#2
I've nerver used the sound feature, but I think using "0" as param instead of "1" will stop the media.
05/27/2013 04:07 pro4never#3
CptSky is correct. That being said you should also keep track of track length server side so you can queue sounds together so they do not overlap too much.
05/27/2013 11:13 LordGragen.#4
thx i will try and let you guys know, but i got 1 more question.

how come some .wav work and some dont?
05/27/2013 13:13 CptSky#5
Quote:
Originally Posted by LordGragen. View Post
thx i will try and let you guys know, but i got 1 more question.

how come some .wav work and some dont?
Run-time ? Bit depth ? Frequency ? Encoding ? (WAV is an audio container, not en encoding format like MP3, PCM, etc)

I've seen several music player with a small limit for the run-time.