Added logic to select sound file based on bitmask