Beispiel #1
0
        private void OnPlayWiimote(object sender, RoutedEventArgs e)
        {
            player.Stop();
            SpeakerConfiguration config = new SpeakerConfiguration {
                Volume = volume,
                //Unknown2 = 0x0c,
                //Unknown3 = 0x0e,
                SampleRate = sampleRate,
                Format     = speakerFormat,
            };

            Wiimote?.DisableSpeaker();
            Wiimote?.EnableSpeaker(config);
            Thread.Sleep(100);
            Wiimote?.DisableSpeaker();
            Wiimote?.EnableSpeaker(config);
            //byte[] configData = Wiimote.ReadData(0x04a20001, 7);
            //if (soundObj is PrebufferedSound prebuffered)
            //	Wiimote?.PlaySound(prebuffered);
            //else
            Wiimote?.PlaySound((byte[])soundObj);
            waveform.Play();
        }