Cannot read PCM file formats with more than 32 bits per sample.

Respuestas (2)

Daniel Shub
Daniel Shub el 13 de Mayo de 2012
I am assuming this comes from trying to use the WAVREAD function. I think the error is pretty straight forward. The PCM file (aka WAV file) has a resolution of greater than 32 bits per samples and MATLAB doesn't know what to do with it.
If you want a suggestion of how to deal with the error, you need to provide more information. Ideally you should edit your question to include
  1. how you created the file
  2. how you read the file
  3. what you are doing with the file once loaded

3 comentarios

1. How i create the file
record_len = 3; %Record time length in seconds
sample_freq = 8000; %Sampling frequency in Hertz
sample_time = sample_freq * record_len;
name='voice_sample';
s='.wav';
file=strcat(name,s);
y = wavrecord(sample_time, sample_freq);
c = end_detection(y);
wavwrite(c,sample_freq,file);
2. How i read the file ( variable b is either m for male or f for female and d1 is the recorded voice that came from the above commands)
a = 'word';
c = '.wav';
for i=1:12 % number of words in database
sum=0;
for j=1:5 % number of samples of each word in database
filename = strcat(a,num2str(i),b,num2str(j),c);
d2=wavread(filename); % reads the file from database
dist = test(d1,d2); % calculates the distance between the recorded voice and the specific file in database
sum=sum+dist;
end;
distance(i)= sum/5;
end;
3.what i am doing with the file once loaded
i calculate the distance from above and the smallest of them is returned.
Note that WAVRECORD is depreciated and you shouldn't use it.
The error most likely comes from
d2=wavread(filename);
It seems like the variable "filename" will be something like word1m1.wav
How did you create these WAV files? Presumably, the format of these WAV files is greater than 32 bits per sample.

Iniciar sesión para comentar.

marina
marina el 13 de Mayo de 2012
hello
I am doing a Matlab project in speech recognition. I have 5 sample files of each word (12 words) that I record, 15kb each approximately. And then I record the word I want to recognize. All of them have bit-rate: 128kbps.
When i enter only 3 words it works perfectly. when i enter all of the 12 words it gives me error "Cannot read PCM file formats with more than 32 bits per sample."
Why is that??
Thank u

2 comentarios

Try changing the order you enter the words in. Does it always happen after 3 words, or does it happen with particular files?
Try using wavinfo() to look at the information about the files.
Generally speaking when I see random errors like that cropping up, I look to be sure that all of the commands for reading the files are correct; random strange errors can show up if a string is used in a place that MATLAB is expecting a numeric array.
This is not an answer, but either a comment to my previous answer or additional information for the question. Please put it in the appropriate place (use the edit "button" to edit your question, or the "comment on this answer" link to add a comment. This information says nothing about the three questions I asked.

Iniciar sesión para comentar.

Productos

Preguntada:

el 13 de Mayo de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by