PiSleepTalk
PiSleepTalk copied to clipboard
process-records.sh crashes when processing special files (don't know exactly when)
Have this log so far:
... processing file: /usr/sleeptalk/records-amplitude/1481432093-max-0.051788-mid-0.010254.wav
... timestamp: 1481432093
... maximum amplitude: 0.051788
... mid amplitude: 0.010254
... is_first_floating_number_bigger: comparing 0.051788 with 0.05200 (to check if the first one is bigger)
... is_first_floating_number_bigger: result is: 0
... is_first_floating_number_bigger: 0.051788 is not bigger than 0.05200
... is_first_floating_number_bigger: comparing 0.010254 with 0.020000 (to check if the first one is bigger)
... is_first_floating_number_bigger: result is: 0
... is_first_floating_number_bigger: 0.010254 is not bigger than 0.020000
... maximum amplitude compare: 0 (0.051788 >= 0.05200)
... mid amplitude compare: 0 (0.010254 >= 0.020000)
... saved end timestamp, it is: 1481432093-max-0.051788-mid-0.010254
... final filename will be: 1481432083-max-0.053223-mid-0.004471-1481432093-max-0.051788-mid-0.010254.wav, saving file to: /usr/sleeptalk/temp/1481432083-max-0.053223-mid-0.004471-1481432093-max-0.051788-mid-0.010254.wav
... files to concat: /usr/sleeptalk/records-amplitude/1481432083-max-0.053223-mid-0.004471.wav /usr/sleeptalk/records-amplitude/1481432086-max-0.061981-mid-0.028229.wav
... normalizing audio
... done normalizing audio
... deleting /usr/sleeptalk/records-amplitude/1481432083-max-0.053223-mid-0.004471.wav /usr/sleeptalk/records-amplitude/1481432086-max-0.061981-mid-0.028229.wav
... appending noise filter
... getting length of audio file: /usr/sleeptalk/temp/1481432083-max-0.053223-mid-0.004471-1481432093-max-0.051788-mid-0.010254.wav
... sox result: Samples read: 308739
Length (seconds): 7.000884
Scaled by: 2147483647.0
Maximum amplitude: 0.944092
Minimum amplitude: -0.838379
Midline amplitude: 0.052856
Mean norm: 0.022132
Mean amplitude: 0.000000
RMS amplitude: 0.046843
Maximum delta: 0.045593
Minimum delta: 0.000000
Mean delta: 0.004516
RMS delta: 0.005873
Rough frequency: 880
Volume adjustment: 1.059
... full seconds: 7.000884
... seconds: 7
... removing trailing zeros from: 000
... string now:
... milliseconds:
bash/process-records.sh: 53: bash/process-records.sh: arithmetic expression: expecting primary: "7000 + "
Looks like a problem with formatting 7.000884