marl / marl/pysox

Maybe a rounding error?

Open
#137 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
540
Forks
83
PR merge metrics
No merged PRs in 30d

Description

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 ?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported transformer snippet, especially the final tfm1.trim(0, 1), and inspect the generated WAV durations with soxi -D at the stated 16 kHz sample rate. Compare outputs that report 0.999938 with those that report 1.000000; done means identifying why the durations differ and documenting or correcting the resulting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.