Moving converter script to user scripts

parent 5f0779fb
%% Read HRIR and export
daff_input_file_path = '2015_ITA-Kunstkopf_HRIR_2ch_D186_5x5_256_v17.daff';
daff_output_file_path_44kHz = 'ITA-Kunstkopf_5x5_256_44kHz.v17.ir.daff';
daff_output_file_path_48kHz = 'ITA-Kunstkopf_5x5_256_44kHz.v17.ir.daff';
h = DAFFv17( 'open', daff_input_file_path );
props = DAFFv17( 'getProperties', h );
md = DAFFv17( 'getMetadata', h );
%% Add new metadata
metadata_v17 = [];
metadata_v17 = daffv17_add_metadata( metadata_v17, 'License', 'String', 'CC BY-SA-NC 4.0' );
%% Copy metadata
for j = 1:numel( md )
switch md( j ).datatype
case 0
md_type = 'BOOL';
case 1
md_type = 'INT';
case 2
md_type = 'FLOAT';
otherwise
md_type = 'STRING';
end
metadata_v17 = daffv17_add_metadata( metadata_v17, md( j ).name, md_type, md( j ).value );
end
%% Export 44 kHz 256 samples
daffv17_write( 'filename', daff_output_file_path_44khz, ...
'metadata', metadata_v17, ...
'datafunc', @dfCopyIR, ... % @dfCopyIR @dfShortenIR @dfPostProcessIR
'userdata', h, ...
'content', props.contentType, ...
'quantization', props.quantization, ...
'channels', props.numChannels, ...
'alphares', props.alphaResolution, ...
'alpharange', props.alphaRange, ...
'betares', props.betaResolution, ...
'betarange', props.betaRange, ...
'orient', props.orientation, ...
'zthreshold', -120 );
%% Export 48 kHz 256 samples
daffv17_write( 'filename', daff_output_file_path_48kHz, ...
'metadata', metadata_v17, ...
'datafunc', @dfResample48kHzIR, ...
'userdata', h, ...
'content', props.contentType, ...
'quantization', props.quantization, ...
'channels', props.numChannels, ...
'alphares', props.alphaResolution, ...
'alpharange', props.alphaRange, ...
'betares', props.betaResolution, ...
'betarange', props.betaRange, ...
'orient', props.orientation, ...
'zthreshold', -120 );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment