[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conversion of '*.bin' to '*.wav' extension



Vinay,

 

If you have access to MatLab this is fairly simple. You can read the file in using fread with the 'int16' option, and then write them out as a .wav file using wavwrite. (That assumes signed 16bit ints, for unsigned use 'uint16')

 

To convert every .bin file in the current working directory to a .wav file, something like the below should work (excuse the messy code, it's not elegant, but will hopefully be effective).

 

input_list = dir('*.bin');

for i = 1:length(input_list)

                fid = fopen(input_list(i).name);

                data = ""

                fclose(fid);

                wavwrite(data,44100,[input_list(i).name(1:length(input_list(i).name)-3),'wav'];

                clear data

end

 

Sam Jelfs

 

From: AUDITORY - Research in Auditory Perception [mailto:AUDITORY@xxxxxxxxxxxxxxx] On Behalf Of Vinay
Sent: 10 August 2010 09:50
To: AUDITORY@xxxxxxxxxxxxxxx
Subject: [AUDITORY] Conversion of '*.bin' to '*.wav' extension

 


Dear list,

I have sound files in the '*.bin' extension format and I need to convert it to  '*.wav' format. The files are ordinary binary files with 16 bit integer values and no file header.

Any suggestions please?



Regards,
Vinay


--
Vinay, PhD, Research Scientist
Acoustics Research Center,
Department of Electronics and Telecommunications,
Norwegian University of Science and Technology (NTNU),
O.S.Bragstads plass 2B
NO-7491 Trondheim, Norway
Tel: +47-45063397
Email: vinay.nagaraj@xxxxxxxxxxx

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.851 / Virus Database: 271.1.1/3061 - Release Date: 08/09/10 19:35:00