NScumm.Sky.Sound.PlaySound C# (CSharp) Method

PlaySound() public method

public PlaySound ( int id, byte sound, int size ) : SoundHandle
id int
sound byte
size int
return NScumm.Core.Audio.SoundHandle
        public SoundHandle PlaySound(int id, byte[] sound, int size)
        {
            var flags = AudioFlags.Unsigned;
            var sizeOfDataFileHeader = ServiceLocator.Platform.SizeOf<DataFileHeader>();
            size -= sizeOfDataFileHeader;
            var buffer = new byte[size];
            Array.Copy(sound, sizeOfDataFileHeader, buffer, 0, size);

            _mixer.StopID(id);

            var stream = new RawStream(flags, 11025, true, new MemoryStream(buffer, 0, size));
            return _mixer.PlayStream(SoundType.SFX, stream, id);
        }

Same methods

Sound::PlaySound ( ushort sound, ushort volume, byte channel ) : void