function submit_lab2(group, type, signal, synth, optional)
%
% SUBMIT_LAB2	Submits Lab 2 data into submission locker for grading
%
%		SUBMIT_LAB2(GROUP_NAME, VOCODER_TYPE, S, SP, TRANS)
%		
%		GROUP_NAME	group name (e.g. 'joecool') or student name
%               VOCODER_TYPE    either 'ch' or 'lp'
%		S		original speech signal (8 kHz)
%		SP		synthesized speech signal (8 kHz)
%               TRANS		optional transgender speech
%	
%		You may call this function as many times as you like, 
%		however, only the last sentences submitted 
%		for each vocoder type will be saved for grading.

root='/mit/6.555/data/submissions/';

maxval=max(abs(signal));
filename=[root group '_' type '_orig.au'];
auwrite(signal./maxval, filename);

maxval=max(abs(synth));
filename=[root group '_' type '_synth.au'];
auwrite(synth./maxval, filename);

if nargin > 4
  maxval=max(abs(optional));
  filename=[root group '_' type '_opt.au'];
  auwrite(optional./maxval, filename);
end
