python-pesq icon indicating copy to clipboard operation
python-pesq copied to clipboard

cant print

Open hidehowever1 opened this issue 5 years ago • 20 comments

a,sr=sf.read('E:/speech/sliced_test_clean/S_01_01.wav') b,sr=sf.read('E:/speech/sliced_test_-5/S_01_01.wav') score=pesq(a,b,sr) print(score) there is no print

hidehowever1 avatar Feb 18 '20 06:02 hidehowever1

hi,Process finished with exit code -1073741571 (0xC00000FD) do you konw why i have this problem

hidehowever1 avatar Feb 18 '20 09:02 hidehowever1

I also encountered this problem, and I didn't find a solution

loongtech-Nitin avatar Feb 29 '20 03:02 loongtech-Nitin

Can you provide the test audios?

vBaiCai avatar Feb 29 '20 03:02 vBaiCai

Can you provide the test audios? i also tried Valentini dataset and had this problem.i dont konw how to upload file in github .but it is just ordinary wav file.are you chinese?.i am a student of post graduate.my qq is 1720705359.we can discuss and i can send you the file

hidehowever1 avatar Feb 29 '20 04:02 hidehowever1

Uploading files is easy, drag and drops it into the comment box.

RKu7x

vBaiCai avatar Feb 29 '20 10:02 vBaiCai

Desktop.zip this is the file

hidehowever1 avatar Feb 29 '20 11:02 hidehowever1

Hi, hidehowever777

To notice that PESQ cannot be computed in some cases. Unfortunately, your data is in this case.

For your data, the C version of PESQ will produce the same results as pypesq.

BTW, the C code assumes that audios are 16-bit-int quantized.
And I notice that the data-type of your audios is 32-bit-float. So, you should convert your data to 16-bit-int quantized.

The attachment is 16-bit-int audios. You can verify the result using C code by yourself. 16bit - samples.zip

vBaiCai avatar Mar 01 '20 09:03 vBaiCai

Desktop.zip Hi,I tried to change the 32-float audio to 16-int audio,but also can not print.If i code like this: b,sr=sf.read('E:/speech/16int/sliced_test_-5/S_01_01.wav') print(b) than b will be [ 0.07687378 0.08346558 -0.01574707 ... -0.15936279 -0.20346069 -0.12380981],It looks like 32-float data even though i have changed to 16-int. However.If use deep learning to do speech enhancement .That should use 32-float data.Do you konw how to deal with this problem.Thank you

hidehowever1 avatar Mar 01 '20 10:03 hidehowever1

Hello, even i try to your samples data, i also meet this error :Process finished with exit code -1073741571 (0xC00000FD) I run it on windows, do you try on it? I try use librosa.load('data/m2_script1_clean.wav', sr=16000) on my own data, but it showProcess finished with exit code -1073741571 (0xC00000FD). And without scores. Can you help me? I am so sad, and don`t how to deal with it.

shazhongcheng avatar Mar 12 '20 10:03 shazhongcheng

The sample data prove that PESQ cannot be calculated in some cases, even if C version is used.

vBaiCai avatar Mar 13 '20 14:03 vBaiCai

The sample data prove that PESQ cannot be calculated in some cases, even if C version is used.

ok,I know.

shazhongcheng avatar Mar 14 '20 02:03 shazhongcheng

When using librosa.load or soundfile.read or anything similar, the best result is obtained by using the optional argument dtype to ensure int16.

Example:

librosa.load('path', dtype='int16')

and

sf.read('path', dtype='int16')

pjnr1 avatar May 18 '20 15:05 pjnr1

@pjnr1 i used the way you told,but also have mistake :librosa.util.exceptions.ParameterError: Audio data must be floating-point

hidehowever1 avatar May 18 '20 15:05 hidehowever1

@pjnr1 i used the way you told,but also have mistake :librosa.util.exceptions.ParameterError: Audio data must be floating-point

@hidehowever777 what format is your sound file?

pjnr1 avatar May 18 '20 16:05 pjnr1

@pjnr1 16int,i send the file for you p232_001.zip

hidehowever1 avatar May 18 '20 16:05 hidehowever1

oh, I see. Doesn't work for librosa. Which is a bid counter-intuitive. The wav-format is implemented so that each sample is save on disk as integer-values. You could convert the file from librosa, assuming the maximum value being 1.0:

x, fs = librosa.load('p232_001.wav')
x = (x * np.iinfo(np.int16).max).astype(np.int16)

That should work. However, that process seems to be included already: https://github.com/vBaiCai/python-pesq/blob/d870dfa9972afa0b82ad0b0d01341010343907ba/pypesq/init.py#L42-L48

pjnr1 avatar May 18 '20 19:05 pjnr1

@pjnr1 sorry,the problem still exist:Process finished with exit code -1073741571 (0xC00000FD)

hidehowever1 avatar May 19 '20 02:05 hidehowever1

@hidehowever777 I guess you can conclude that the file format isn't the problem then. Sorry.

pjnr1 avatar May 19 '20 11:05 pjnr1

I had the same problem. Please advise. problems: Process finished with exit code -1073741571 (0xC00000FD) sampling rate:8000

sunjihai avatar Dec 08 '20 10:12 sunjihai

The above audio file has sample rate of 16000, which is working on C version pesq script, just to be clear, the C version has been rescripted in python script, which is working fine. The pesq score for the above audio is 1.027367353439331

arunraj-sandeza avatar Mar 22 '23 07:03 arunraj-sandeza