TIMIT corpus audio format conversion

      TIMIT is a classic corpus founded by MIT in 1993 and is suitable for speech recognition, speaker classification, etc., but matlab cannot directly process the audio in TIMIT, because it is a SPHERE file format, so a certain format conversion must be performed first.

 

code show as below:

 

function wavdata=readTIMITwav(filepath)
% author:
% Zheng Rui
% date:
%          2013-12-29
% function:
% Implement the function of reading audio files in the TIMIT corpus
% filepath:
% Path to audio file in TIMIT corpus
% wavdata:
% audio file

clc;
clear all;

fidin=fopen(filepath,'r'); % Open the file and specify the operation mode of the file as read-only
A = fread(fidin,inf,'int16'); % Read all the data of the file in binary form, the precision is 16-bit integer
wavdata=A./(2^15); % SPHERE file header 1024 bytes, converted to wav format
fclose(fidin); % close the file

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326721873&siteId=291194637