using shared function for starting, stopping, and looping music if needed