bleeck@3: % method of class @ bleeck@3: % function writetofile(sig,name) bleeck@3: % INPUT VALUES: bleeck@3: % sig: signal to save bleeck@3: % name: filename bleeck@3: % RETURN VALUE: bleeck@3: % none bleeck@3: % bleeck@3: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: bleeck@3: bleeck@3: function writetofile(sig,name) bleeck@3: %usage: writetofile(sig,name) bleeck@3: %DRRSmith 28/05/02 bleeck@3: %readsounddata=getdata(sig); bleeck@3: %fid=fopen(name,'wb'); bleeck@3: %fwrite(fid,readsounddata,'int16'); bleeck@3: %fclose(fid); bleeck@3: bleeck@3: readsounddata=getdata(sig); bleeck@3: if (isunix==1) bleeck@3: fid=fopen(name,'wb','b'); %bigendian bleeck@3: fwrite(fid,readsounddata,'int16'); bleeck@3: fclose(fid); bleeck@3: else bleeck@3: fid=fopen(name,'wb','l'); %littleendian bleeck@3: fwrite(fid,readsounddata,'int16'); bleeck@3: fclose(fid); bleeck@3: end bleeck@3: bleeck@3: % readsounddata=getdata(sig); bleeck@3: % fid=fopen(name,'wb',endian); bleeck@3: % fwrite(fid,readsounddata,'int16'); bleeck@3: % fclose(fid);