clear all
%load the allophone table
fid = fopen(...
 'C:\BRL_documents\WebSites\ee476site\Speech\ALLPHONS.BIN');
allo = fread(fid,inf,'uint8');
%remove DC bias 
allo = allo-128;

%load the allophone starting points
fname=...
 'C:\BRL_documents\WebSites\ee476site\Speech\tables.txt';
a = textread(fname,'%d',59*2);
%convert starting point table to numbers
for i=1:59
    addr(i) = 256*a(i) + a(i+59)+1;
end
%allophones are in same order as SPO256 chip, but without the pauses
%say BOY
%soundsc([allo(addr(59)+1500:end); allo(addr(1):addr(2)-1)],8000) %BOY
quiet10 = zeros(800,1);
%say MEGA32
soundsc([allo(addr(12):addr(13)-1) ;...
         allo(addr(16):addr(17)-1); ...
        allo(addr(30):addr(31)-1); ...
        allo(addr(20):addr(21)-1); ...
        quiet10 ; ...
        allo(addr(25):addr(26)-1); ...
        allo(addr(35):addr(36)-1); ...
        allo(addr(13):addr(14)-1); ...
        allo(addr(15):addr(16)-1); ...
        ...
        allo(addr(13):addr(14)-1); ...
        allo(addr(27):addr(28)-1); ...
        quiet10 ;
        allo(addr(51):addr(52)-1); ...
        allo(addr(5):addr(6)-1); ...
        allo(addr(15):addr(16)-1); ...
        allo(addr(33):addr(34)-1); ...
    ],8000) 