ptwz / python_wizard

Command line LPC analysis tool to generate bitstreams for the Texas Instruments TMS5220 chip
MIT License
40 stars 13 forks source link

Error processing some audio files #2

Closed deladriere closed 6 years ago

deladriere commented 6 years ago

(If you want to try it with my files, they are here : audio files)

when processing some audio files I have a warning like :

/Users/***pywizard/Buffer.py:99: RuntimeWarning: invalid value encountered in double_scalars
  coefficients[lag] = s / (rmsBeginning * rmsEnding)

when running python python_wizard.py -u 0.3 -w 2 -S -p -a -0.9375 -m 0.9 -f hex arcb.wav

but the encoding works

sometimes Its also give me this error : (with the file wftatc.wav)

/Users/***pywizard/Buffer.py:99: RuntimeWarning: invalid value encountered in double_scalars
  coefficients[lag] = s / (rmsBeginning * rmsEnding)
Traceback (most recent call last):
  File "python_wizard.py", line 73, in <module>
    x=Processor(b)
  File "/Users/***pywizard/Processor.py", line 27, in __init__
    self.pitchTable = self.pitchTableForBuffer(self.pitchBuffer)
  File "/Users/***pywizard/Processor.py", line 61, in pitchTableForBuffer
    pitchTable[index] = PitchEstimator.pitchForPeriod(buf)
  File "/Users/***pywizard/PitchEstimator.py", line 8, in pitchForPeriod
    return cls(buf).estimate()
  File "/Users/***pywizard/PitchEstimator.py", line 43, in estimate
    subMultiplePeriod = int( sp.floor( (i+1) * estimate / maximumMultiple + .5) )
ValueError: cannot convert float NaN to integer

but here the encoding doen't work.

(these files works fine in BlueWizard)

deladriere commented 6 years ago

oops just realized there is a cleanup version: warnings are now gone but I still have the same error with wftatc.wav or ss.wav

ptwz commented 6 years ago

Thank you for bringing it up. I had some uncertainties about one line that checked for NaN that I did not port. It should work in the cleanup branch now, please check it out and let me know if it works.

deladriere commented 6 years ago

Ok no more error ! it works

ptwz commented 6 years ago

Thanks, I will merge the branch then