Commit 45d3c31c authored by Gregory Pallone's avatar Gregory Pallone
Browse files

fix: save2mat

parent c78cf290
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -30,20 +30,26 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function SOFA_save_to_mat(Lib_Name,spkLayout,outputSofaPath,sampleRates)
function SOFA_save_to_mat(Lib_Name,spkLayout,gain,outputSofaPath,sampleRates)
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here

if nargin == 1
    spkLayout = '';
    gain = 1;
    outputSofaPath = [erase(Lib_Name,'.sofa') '.mat'];
    sampleRates = [48000 32000 16000];
end
if nargin == 2
    gain = 1;
    outputSofaPath = [erase(Lib_Name,'.sofa') '.mat'];
    sampleRates = [48000 32000 16000];
end
if nargin == 3
    outputSofaPath = [erase(Lib_Name,'.sofa') '.mat'];
    sampleRates = [48000 32000 16000];
end
if nargin == 4
    sampleRates = [48000 32000 16000];
end

@@ -216,6 +222,7 @@ if isfile(Lib_Name)
            Sofa.PosSpherical = Sofa.PosSpherical(:,chSelect);
        end

        Sofa.Data.IR = Sofa.Data.IR * gain;
        
        % Now, get the impulse repsonses:
        Sofa.DataType = 'FIR';