Skip to content

audinterface.Segment reorders ends entries when file argument given to process_signal #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hagenw opened this issue Jul 27, 2023 · 0 comments · Fixed by #136
Closed
Labels
bug Something isn't working

Comments

@hagenw
Copy link
Member

hagenw commented Jul 27, 2023

import audinterface
import numpy as np

segment = audinterface.Segment(
    process_func=lambda x, sr: audinterface.utils.signal_index([0, 1], [3, 2])
)
signal = np.zeros((1, 3 * 8000))
sampling_rate = 8000

Then we get correctly:

>>> segment.process_signal(signal, sampling_rate)
MultiIndex([('0 days 00:00:00', '0 days 00:00:03'),
            ('0 days 00:00:01', '0 days 00:00:02')],
           names=['start', 'end'])

But when providing the file argument, end times are reordered (maybe sorted?):

>>> segment.process_signal(signal, sampling_rate, file='f')
MultiIndex([('f', '0 days 00:00:00', '0 days 00:00:02'),
            ('f', '0 days 00:00:01', '0 days 00:00:03')],
           names=['file', 'start', 'end'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant