1
votes

How to read a particular phoneme generated using htk mlf file in Matlab. I want to access the particular time duration of phoneme in MLF file. For example if the phoneme segment is 200000 800000 dh I want to read the wave file at 0.2 ms to 0.8 ms

2

2 Answers

1
votes

You can read the file as a whole, and cut segments you need

[signal, fs] = wavread('file.wav')

start_sample = fs * 200000 / 1000000
end_sample = fs * 800000  / 1000000

phoneme_signal = signal(start_sample:end_sample)

You can also specify the range in wavread if you know the frequency already:

start_sample = fs * 200000 / 1000000
end_sample = fs * 800000  / 1000000

[phoneme_signal, fs] = wavread('file.wav', [start_sample, end_sample])
1
votes

You could use the audioread function which provides a samples argument letting you specify the beginning and the end of the signal you want to acquire :

% Suppose 'Fs' is the sampling frequency %
begin = 2^(-5) * Fs;
end = 8^(-5) * Fs;
[signal, fs] = audioread('file.wav', [begin,end]);