function mysoundsc(y, fs) % MYSOUNDSC works like soundsc() but writes to a % temporary file and plays the signal using % a player (play, realplay, xmms, ...) from operating system. % % Usage: mysoundsc(y, fs); % % Use ONLY when soundsc(y, fs) does not work. % This happens often with Linux/UNIX computers. % % By default, calls for "play". % If needed, change the code. % % Jukka Parviainen, 10.5.2007 / 22.2.2006 wavwrite(0.99*y/max(abs(y)), fs, 'roska45.wav'); % Not a scaled, data clipping possible % wavwrite(y, fs, 'roska45.wav'); % Call for player in OS %!realplay roska45.wav % Reminder: %fprintf(1, 'Using linux "realplay" in playing audio...\n'); % Call for player in OS % % Direct call to OS: %!play roska45.wav % % Or using eval-command you can modify your filename if needed eval(['!play roska45.wav']); %eval(['!play ' filename]); fprintf(1, 'Using linux "play" in playing audio...\n');