Commit 1d2e139a authored by Jan Brouwer's avatar Jan Brouwer
Browse files

bug fix in text_to_binary_payload.py script

parent 3581197f
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -113,17 +113,18 @@ def parse_reverb_text_configuration_and_generate_binary_payload(file):
            assert False, 'unknow frequency grid method'

    # parse acoustic environments
    data += bitarray(
        get_count_or_index_code(len(sections['acousticEnvironment'])))              # revNrElements 
    for index, ae in sections['acousticEnvironment'].items():
        data += bitarray(
              get_count_or_index_code(len(sections['acousticEnvironment']))         # revNrElements 
            + get_id_code(eval_option(index))                                       # revAcEnvID 
              get_id_code(eval_option(index))                                       # revAcEnvID 
            + get_count_or_index_code(eval_option(ae['frequencyGridIndex']))        # revFreqGridIdx
            + get_duration_code(eval_option(ae['predelay']))                        # revPredelay
            + concatenate(get_duration_code, eval_option(ae['rt60']))               # revRT60
            + concatenate(get_dsr_code, eval_option(ae['dsr']))                     # revDSR
            + get_bool_code('earlyReflectionsSize' in ae))                          # hasEarlyReflections
        if 'earlyReflectionsSize' in ae:
            assert len(eval_option(ae['absorptionCoefficients'])) == nr_bands[eval_option(ae['frequencyGridIndex'])] * 6, 'wrong number of absorption coefficients'
            assert len(eval_option(ae['absorptionCoefficients'])) == nr_bands[eval_option(ae['earlyReflectionsfrequencyGridIndex'])] * 6, 'wrong number of absorption coefficients'
            data += bitarray(
                  concatenate(lambda d : get_distance_code(d, True), eval_option(ae['earlyReflectionsSize']))  # erSize
                + get_count_or_index_code(eval_option(ae['earlyReflectionsfrequencyGridIndex']))               # erFreqGridIdx