vBaiCai / python-pesq

A python package for calculating the PESQ.
MIT License
353 stars 69 forks source link

PESQ score for the .raw file #24

Closed benlin1996 closed 3 years ago

benlin1996 commented 3 years ago

Thanks for the wonderful code. In your example, I guess it is for .wav file. But for the audio in .raw, is this function still valid? And what is the correct reading function for .raw file.

Thanks for your help.

vBaiCai commented 3 years ago

What do you mean by the .raw file?

You need to find out data type and sample rate of the audiofile, in advance.

If .raw is the 16bit 16kHz PCM, you can load it as:

import numpy as np
x = np.fromfile('xxx.raw', dtype=np.int16) / 32768.0
benlin1996 commented 3 years ago

Thanks for your help, I will try your method