%************************************************************************** 
%*File name  : All_Player.m
%*Author     : DLS
%*Description: This script lets you play '.08' raw extension files through
%*             matlab. 
%**************************************************************************
clear all 
clc
close all
dinfo = dir('*.08');
prompt = 'Do you want to Quit: Y/N [Y]: ';
for K = 1 : length(dinfo)
  clear A B fid delay;
  fid = fopen(dinfo(K).name);
  A   = fread(fid, Inf, 'int16','b')/65536;
  B = audioplayer(A,8192);
  play(B)
  delay = length(A) * 0.00013;
  fclose(fid);
  t = 0:1/8192:delay;
  t = t(1:length(A));
  plot(t,A);
  pause(delay);
  str = input(prompt,'s');
  if str == 'Y' | str == 'y'
      return;
  end 
  clc
  close all
end
