Add a speaker object to your scene.
The speaker object has just the functionality you are after.
The speaker object is used to give sound in the 3D View. After adding the object, the various settings can be changed in the Properties editor.
Add a speaker to the scene Add > Object > Speaker
Add sound and fill in the properties accordingly.
Image from blender docs Image from 2.83
The speaker object can be animated as other objects.