def normalize_speaker_mapping(channels, speaker_mapping)
      if speaker_mapping.nil?
        speaker_mapping = default_speaker_mapping(channels)
      elsif !speaker_mapping.is_a?(Array)
        return speaker_mapping
      else
        speaker_mapping = speaker_mapping.dup
      end

      if speaker_mapping.length < channels
        speaker_mapping += [:undefined] * (channels - speaker_mapping.length)
      end

      speaker_mapping.freeze
    end
def normalize_speaker_mapping(channels, speaker_mapping)
      if speaker_mapping.nil?
        speaker_mapping = default_speaker_mapping(channels)
      elsif !speaker_mapping.is_a?(Array)
        return speaker_mapping
      else
        speaker_mapping = speaker_mapping.dup
      end

      if speaker_mapping.length < channels
        speaker_mapping += [:undefined] * (channels - speaker_mapping.length)
      end

      speaker_mapping.freeze
    end
Internal