Changing the volume ( amplitude ) of sounds

In this article we are gonna play with amplitude of sounds. We will learn how to increase or decrease volume by manipulating amplitude. As we know amplitude of sound is the main factor in volume. Increasing or decreasing amplitude means increasing volume or decreasing volume. We defined three methods ( increaseVolume, decreaseVolume & changeVolume ) in mysound class.

Note : You can’t increase or decrease volume of your device with this code. So, don’t confuse yourself. we are just changing amplitude and it does not mean anything else.