function get_audio_length(ctl,config_options)

%%%%%%%%%%%%
% default parameters
% and reading config file
if nargin == 1
	shiftFile = 'none';
else
	fid_param = fopen(config_options);
	CO1 = textscan(fid_param,'%s%s','MultipleDelimsAsOne',1);
	fclose(fid_param);

	pVals = CO1{2};

	shiftFile = pVals{1};
end

if strcmp(shiftFile,'none') ~= 1
	fid_shift = fopen(shiftFile,'w'); %open file to write out shift values
end

fid = fopen(ctl);
L1  = textscan(fid,'%s%s','delimiter',',');
fclose(fid);
inList = L1{1}; outList = L1{2}; shifts = zeros(length(inList),1);
for cnt = 1:length(inList)
 tline = strtrim(inList{cnt});
 %fid2  = fopen(tline,'r');

 x_in = readsph(tline);

 audio_length = length(x_in); 

 if strcmp(shiftFile,'none') ~= 1
 	fprintf(fid_shift,'%f\n',audio_length);  
 end
 
end
if strcmp(shiftFile,'none') ~= 1
	fclose(fid_shift);
end
