home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / windows3 / mtlabsnd.zip / PLAY.M < prev    next >
Text File  |  1993-04-26  |  609b  |  25 lines

  1. function play(filename)
  2.  
  3. % play(filename)
  4. %
  5. %       filename = valid dos filename of a .WAV file, without extension
  6. %       
  7. %       Plays a Windows .WAV file through the system speakers.  Prompts
  8. %       for input as to whether the user wants the sound played again.
  9. %
  10.  
  11. if (nargin ~= 1)
  12.   error('PLAY: number of input arguments must be one.');
  13. end;
  14.  
  15. if (nargout ~= 0)
  16.   error('PLAY: number of output arguments must be zero.');
  17. end;
  18.  
  19. eval(['!playw ' filename '.wav']);
  20.  
  21. while ~isempty(input('Enter 1 to play again, <RETURN> to continue... '))
  22.   eval(['!playw ' filename '.wav']);
  23. end
  24.  
  25.