Commit b8a5b505 authored by emerit's avatar emerit
Browse files

fix bug update scripts to support others sofa files with samples rates other thab 48 khz

parent f6755d5a
Loading
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -46955,8 +46955,8 @@ const float fastconvReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX] =
/*
/* Binaural rendering data set based on BRIRs */
/* Tables derived from Mozart IIS BRIRs.*/
Binaural rendering data set based on BRIRs 
Tables derived from Mozart IIS BRIRs.*/
 
const float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]=
@@ -47519,4 +47519,3 @@ const float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX] = {
#undef WMC_TOOL_SKIP
/* clang-format on */
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ def load(
    np.ndarray,
    np.ndarray,
]:
    hrtf = Dataset(filename, "r", format="NETCDF4")
    hrtf = Dataset(filename, "r")
    Database_Name = hrtf.DatabaseName
    Listener_Short_Name = hrtf.ListenerShortName
    latencys = 0
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
%   the United Nations Convention on Contracts on the International Sales of Goods.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear -regexp ^((?!writeRomFileOutput|writeBinaryOutput|writeEachRendererBinaryOutput|rom_file|bin_file|hrir_file|brir_file|ivas_path|binary_path|output_bin_name|param_bin_file|fastconv_bin_file|td_binary_file|binary_name).)*$
clear -regexp ^((?!writeRomFileOutput|writeBinaryOutput|writeEachRendererBinaryOutput|rom_file|bin_file|hrir_file|brir_file|ivas_path|binary_path|output_bin_name|param_bin_file|fastconv_bin_file|td_binary_file|binary_name|rom_path).)*$
close all;
clc;

+6 −2
Original line number Diff line number Diff line
@@ -981,6 +981,8 @@ int main( int argc, char *argv[] )
        convert_backslash( argv[i] );

        err = generate_crend_ivas_tables_from_sofa( argv[i], &cfgBrirOptim );
        if ( err != 0 )
            return err;

        if ( ( h_file_path != NULL ) && ( c_file_path != NULL ) )
        {
@@ -1020,7 +1022,9 @@ int main( int argc, char *argv[] )
#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES
    if ( sofa_file_path_for_reverb != NULL )
    {
        generate_reverb_ivas_tables_from_sofa( sofa_file_path_for_reverb );
        err = generate_reverb_ivas_tables_from_sofa( sofa_file_path_for_reverb );
        if ( err != 0 )
            return err;
    }
#endif
    if ( ( h_file_path != NULL ) && ( c_file_path != NULL ) )
@@ -1204,7 +1208,7 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c
        usage_gen_crend_tables();
        free( sofa_file_path );

        return err;
        return -1;
    }
    hrtf->lookup = NULL;
    hrtf->neighborhood = NULL;
+6 −5
Original line number Diff line number Diff line
@@ -65,8 +65,9 @@ brir_file_name = 'IIS_BRIR_officialMPEG_Combined.sofa';
hrir_path = fullfile ('.','HRIRs_sofa');
brir_path = fullfile ('.','BRIRs_sofa');
%% Set output files
rom_path = [ivas_path 'lib_rend'];
binary_path = fullfile ('.','binaural_renderers_hrtf_data');
binary_name = 'HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000+IIS_BRIR_officialMPEG_Combined';
binary_name = [erase(hrir_file_name,'.sofa') '+' erase(brir_file_name, '.sofa') ];
output_bin_name = 'ivas_binaural';
if(exist(binary_path, 'dir')==0)
  mkdir(binary_path);
@@ -83,7 +84,7 @@ dataSpec.subjId = 'custom';
dataSpec.hrfInDir = hrir_file;
dataSpec.hrfOutDir = binary_path;
dataSpec.genRomFile = writeRomFileOutput;
dataSpec.romOutDir = [ivas_path 'lib_rend'];
dataSpec.romOutDir = rom_path;
Mod_Hrf_Itd_Main(dataSpec);

%% generate crend rom  or binary values
@@ -92,7 +93,7 @@ convert_SD2SHD_HRIRs(hrir_path,hrir_file_name,128);
command = ['.' filesep() 'generate_crend_ivas_tables'];

if writeRomFileOutput == true
    command = [command ' -lib_rend_path ' ivas_path 'lib_rend'];
    command = [command ' -lib_rend_path ' rom_path];
end
if writeBinaryOutput == true
    command = [command ...
@@ -123,7 +124,7 @@ end

fastconv_bin_file = ['fastconv_' erase(hrir_file_name, '.sofa') '_' erase(brir_file_name, '.sofa') '.bin'];
bin_file = fullfile('.',binary_path, fastconv_bin_file );
rom_file = fullfile(ivas_path,'lib_rend', 'ivas_rom_binauralRenderer.c');
rom_file = fullfile(rom_path, 'ivas_rom_binauralRenderer.c');

copyfile('ivas_license_header.template',rom_file,'f');

@@ -156,7 +157,7 @@ param_bin_file = ['parambin_' erase(hrir_file_name, '.sofa') '_' erase(brir_file
bin_file = fullfile('.',binary_path, param_bin_file );
generate_tables_for_parametric_binauralizer

rom_file = fullfile(ivas_path,'lib_rend', 'ivas_rom_binauralRenderer.c');
rom_file = fullfile(rom_path, 'ivas_rom_binauralRenderer.c');

fp = fopen(rom_file,'at');

Loading