Skip to content
Snippets Groups Projects
Commit e9d47344 authored by leprob001's avatar leprob001
Browse files

Added function for loading .soso files. Added test function as well.

parent 9cf9d431
No related branches found
No related tags found
No related merge requests found
function [datafile] = load()
%LOAD Loads a test soso file into memory.
[currentDirectory, ~, ~] = fileparts(mfilename('fullpath'));
dataFileName = fullfile(currentDirectory, '..', 'data', 'HAFOS.soso');
datafile = artoa.load.soundsource(dataFileName);
end
File added
function [ soundsource ] = soundsource(pFilename)
%RFB Loads a .soso file into memory using the tomlini function.
% Creates a struct that contains the sections as properties.
%
% Parameters:
% pFilename (string) The filename to be read.
%
%% Initialize input parameter
soundsource = false;
%% Parameter check
parameter_error = false;
if (~ischar(pFilename))
warning([mfilename ': pFilename is not a string!']);
parameter_error = true;
else
% get filename details
[pathstr, name, ext] = fileparts(pFilename);
if (~strcmp(ext, '.soso'))
warning([mfilename ': Please check input parameter. Wrong file extension! Should be .soso!']);
parameter_error = true;
end
end
if parameter_error
return; % return if parameter check has not been passed successfully
else
clear parameter_error;
end
soundsource = artoa.load.tomlini(pFilename);
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment