/** * WaveIn event handlers */ // called from waveIn_DataAvailable private void writeBufferToFile(byte[] buffer, int bytesRecorded) { int toWrite = (int)Math.Min(maxFileLength - writer.Length, bytesRecorded); if (toWrite > 0) { writer.WriteData(buffer, 0, bytesRecorded); } else { // done writing this.state = AudioTrackState.Loaded; } }
public void Read(BinaryReader reader) { Track = new AudioTrackState(); Track.Event = reader.ReadNullTerminatedString(); Track.Progress = reader.ReadInt32(); int count = reader.ReadByte(); for (int i = 0; i < count; i++) { MEP param = new MEP(); param.Key = reader.ReadNullTerminatedString(); param.Value = reader.ReadSingle(); Track.Parameters.Add(param); } }
private IEnumerator UnlockRoutine(Follower fol) { SoundEmitter emitter = SoundEmitter.Play(unlockSfxName, this, null); emitter.Source.DisposeOnTransition = true; Level level = SceneAs <Level>(); Key key = fol.Entity as Key; Add(new Coroutine(key.UseRoutine(Center + new Vector2(0f, 2f)), true)); yield return(1.2f); UnlockingRegistered = true; bool flag = stepMusicProgress; if (flag) { AudioTrackState music = level.Session.Audio.Music; int progress = music.Progress; music.Progress = progress + 1; level.Session.Audio.Apply(false); } //level.Session.DoNotLoad.Add(this.ID); key.RegisterUsed(); while (key.Turning) { yield return(null); } Tag |= Tags.TransitionUpdate; Collidable = false; emitter.Source.DisposeOnTransition = false; yield return(sprite.PlayRoutine("open", false)); level.Shake(0.3f); Input.Rumble(RumbleStrength.Medium, RumbleLength.Medium); yield return(sprite.PlayRoutine("burst", false)); RemoveSelf(); yield break; }
public ChunkEAudioTrackState(AudioTrackState track) { Track = track; }
void waveOut_PlaybackStopped(object sender, EventArgs e) { this.state = AudioTrackState.Loaded; }