Open
Description
Let's consider the following code:
import audinterface
import audiofile
import numpy as np
sampling_rate = 8000
signal = np.concatenate(
[np.zeros((1, 8000)), np.ones((1, 8000))],
axis=1,
)
file = 'file.wav'
audiofile.write(file, signal, sampling_rate)
segment = audinterface.Segment(
process_func=lambda x, sr:
audinterface.utils.signal_index(1, 0)
)
process = audinterface.Process(segment=segment)
It defines a segmentation object that returns start
and end
values in a wrong order,
but still not totally meaning less:
>>> segment.process_file(file)
MultiIndex([('file.wav', '0 days 00:00:01', '0 days')],
names=['file', 'start', 'end'])
If this is used as a segment
object inside audinterface.Process
it will process a segment with 1 duration, it reads the segment at the correct position, but returns wrong timestamps:
>>> process.process_file(file)
file start end
file.wav 0 days 00:00:01 0 days 00:00:02 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...
dtype: object
Expected behavior would have been:
>>> process.process_file(file)
file start end
file.wav 0 days 00:00:00 0 days 00:00:01 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...
dtype: object