WaveStream bgm1Stream = new Mp3FileReader(new System.IO.MemoryStream(Resources.音楽1)); WaveOut bgm1 = new(); WaveStream se1Stream = new Mp3FileReader(new System.IO.MemoryStream(Resources.効果音1)); WaveOut se1 = new(); public Form1() { bgm1.Init(bgm1Stream); se1.Init(se1Stream); } private void SoundPlay(int bgm) { if (bgm == -1) { if (bgm1Stream.Position <= 0 || bgm1Stream.Position >= bgm1Stream.Length - 1000) { bgm1Stream.Position = 0; bgm1.Play(); } } if (bgm == 1) { if (se1Stream.Position <= 0 || se1Stream.Position >= 120000) { se1.Stop(); se1Stream.CurrentTime = TimeSpan.FromSeconds(0.55); se1.Play(); } } }