public void LoadSong(Stream data) { if (music != IntPtr.Zero) { StopSong(); } var br = new BinaryReader(data); var bytes = br.ReadBytes((int)(data.Length - data.Position)); music = SDL_mixer.Mix_QuickLoad_WAV(bytes); }
public int PlaySfx(byte[] data) { if (data == null || data.Length == 0) { return(-1); } var sound = SDL_mixer.Mix_QuickLoad_WAV(data); var channel = SDL_mixer.Mix_PlayChannel(-1, sound, 0); //SDL_mixer.Mix_Volume(channel, 64); // TODO: Customizable volume return(channel); }
public void LoadSong(Stream data) { if (music != IntPtr.Zero) { StopSong(); } musicBytes = new byte[data.Length - data.Position]; data.ReadAsync(musicBytes, 0, (int)(data.Length - data.Position)); // Wait until SOMETHING gets written out while (musicBytes[8] == 0) { Thread.Sleep(1); } music = SDL_mixer.Mix_QuickLoad_WAV(musicBytes); }
public WAV(byte[] Mem) { myPtr = SDL_mixer.Mix_QuickLoad_WAV(Mem); CheckPtr(); }