Dear student,
sound waves are formed when a vibrating object causes the surrounding medium to vibrate. A medium can be anything (air, water or solid) through which the waves travel . The loudness of sound depends upon how far the wave travels. The farther the wave travels the more it spreads and sound will be difficult to hear, so the nearer you are to the source the louder it is heard.
regards