k2kobayashi / k2kobayashi/Shifter
bug in transform(......)
- Dominant language
- Python
- Stars
- 40
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
I got a corruption when using function: f0trans.transform(....)
mycode is like below:
def changePitch(pitch_r, sample_data, sample_rate=16000):
# F0 transoformation based on WSOLA and resampling
f0trans = Shifter(sample_rate, pitch_r, frame_ms=20, shift_ms=10)
transformed = f0trans.transform(sample_data)
return transformed
--size of sample_data is 416600,pitch_r is 0.9
Error message:
Traceback (most recent call last):
File "audio_process.py", line 269, in
data = audio_process.changePitch(pitch_ratio, data, sample_rate)
File "audio_process.py", line 230, in changePitch
transformed = f0trans.transform(sample_data)
File "audio_process.py", line 59, in transform
wsolaed = self.duration_modification(data)
File "audio_process.py", line 112, in duration_modification
wsolaed[outp:outp + self.sl] = spdata + epdata
ValueError: could not broadcast input array from shape (160) into shape (60)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in audio_process.py at Shifter.transform and its duration_modification call, especially the assignment around line 112. Reproduce with sample_data of size 416600, pitch_r 0.9, and sample rate 16000, then inspect why the output slice is shorter than the arrays being added. Done means transform completes without the broadcasting ValueError for this input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100