Question: Xamarin Forms This is basically a modification of the MonkeyTapWithSound to make it respond faster from the book at https://docs.microsoft.com/en-us/xamarin/xamarin-forms/creating-mobile-apps-xamarin-forms/ The last bit of instructions

Xamarin Forms

This is basically a modification of the MonkeyTapWithSound to make it respond faster from the book at https://docs.microsoft.com/en-us/xamarin/xamarin-forms/creating-mobile-apps-xamarin-forms/

The last bit of instructions for this modification are as follows:

5. Split PlaySound into a MakeBuffer method with parameters (frequency) that returns a sound buffer, and another method PlayBufferedSound with the parameter (). 6. Add a method to MonkeyTapWithSoundPage to initialize the buffers in SoundPlayer. A good choice is to override InitializeBoxView. This method should step through the 4 existing frequencies and add a 5th buffer for the error sound. Make a for loop to set up buffers 0, 1, 2 and 3 with the frequency and flashDuration, and one more call outside the loop with endFrequency and errorDuration Modify FlashBoxView to call PlayBufferedSound with buffers[index] and flashDuration, and EndGame to use PlayBufferedSound with endBuffer and endDuration.

Anyways, I've hit a wall and I'm not sure on how to finish this page.

Here's the code I have so far for the MonkeyTapWithSoundPage.cs:

namespace MTWSFast { class MonkeyTapWithSoundPage : MonkeyTap.MonkeyTapPage { const int errorDuration = 500;

// Diminished 7th in 1st inversion: C, Eb, F#, A double[] frequencies = { 523.25, 622.25, 739.99, 880 }; double endFrequency = 65.4;

List buffers; byte[] endBuffer;

protected override void FlashBoxView(int index) { SoundPlayer.PlaySound(frequencies[index]); base.FlashBoxView(index); }

protected override void InitializeBoxView() { buffers = new List(); for(int i = 0; i

protected override void EndGame() { SoundPlayer.PlaySound(65.4); base.EndGame(); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!