Project 1: Milestone 3
The final project turned out about as well as I hoped for. The sound cuts out and the timer stops when the app is closed. The colors I was also able to change to white on black which makes the app less inviting. I was also able to make the sound smooth even when all sliders were in use.
The coding is a bit unconventional. Instead of using the buffer from the audio engine built into swift, I created timer to add a new version of the audio clip after 4 seconds which will create a memory leak due to the clip being a tenth of a second longer than the timer. Originally, I stopped the audio player and restarted it each cycle but the delay of stopping and starting made the playback choppy.
The oscillation is also hacked together. The audio engine should be set up with an oscillator node but due to it complexity I created a timer that changes based on the volume and, using a sine wave, updates the volume every .1 seconds.
Going forward with the app, I would like to make the sound modulation better as the current sound becomes a whine when put up to higher frequencies. I would also expand the button area to encompass more of the screen. I would also like to add multiple frequencies that the user can choose from instead of modulating a single sound. Lastly, the app should tack study time and give a report based on the persons study habits and give advice to study more, study less or invite the user to get a different app if they are using it for sleeping.