function url = makeSinWavFileOnWeb(freq,dur,vol,sampRate,bitsPerSamp,dir,file)
% makeWavFileOnWeb   take samples and put on the web as a wave file
%
% Consumes:
%   freq,dur    scalar numbers: frequency (Hz), duration (in sec)
%   vol         scalar number, volume: volume, in range [0,1)
%                should be strictly less than 1 to avoid clipping/distortion
%   sampRate   scalar number, the number of samples per second (e.g. 44100)
%   bitsPerSamp   scalar number, the number of bits per sample   (e.g. 16)
%   dir        char string, the directory in which to put the file
%                 this directory will be created if it doesn't
%                 exist, and chmod'ed to make it readable
%               directories above this one are assumed to already
%               be readable--if not, they need to be chmod'ed manually.
%   file       char string, the filename for the wave file
%  
% Produces:  
%  
%    url:     the URL of the file that contains the samples
%  
% Example:
%
%  >> makeWavFileOnWeb(440,3,0.9,44100,16,'cisc106/10.31','A440_3sec.wav')
%  ans =
%
%      http://copland.udel.edu/~pconrad/cisc106/10.31/A440_3sec.wav
%
%  >>
%  
% P.Conrad for CISC106, 10/31/2007
  
  % create the samples
    
    samples = vol * sineWavVector(sampRate,freq,dur);
  
    url = makeWavFileOnWeb(samples,sampRate,bitsPerSamp,dir,file);
    
    return;

end % function
    