Skip to content

Maybe a rounding error? #137

Open
Open
@StuartIanNaylor

Description

@StuartIanNaylor

The main transformer snippet of my code is

  t  pad = (1 - duration)
  startpad = abs(pad * pad_offset) / 2
  endpad = 1 
  tfm1.pitch(pitch_offset)     
  tfm1.tempo(tempo_offset, 's')
  tfm1.pad(startpad, endpad)
  tfm1.trim(0, 1)
  tfm1.build_file('temp.wav', filename + '-av-' + str(x) + '.wav')

The main thing is the last tfm1.trim(0, 1) as the output from soxi -D

0.999938
pangram1029-av-17.wav
0.999938
pangram1029-av-18.wav
1.000000
pangram1029-av-19.wav
0.999938
pangram1029-av-1.wav
0.999938
pangram1029-av-20.wav
0.999938
pangram1029-av-2.wav
1.000000

Why does that final trim sometimes (not always) and how does soxi -D get a fraction of the sample rate 15999.008 samples = 0.999938 sec @ 16kSR ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions