added boundary checks for sound/music ID for some sound and music functions