The most efficient approach may be to create a Python script as a custom loader using pydub
to slice the segments by looping through each start_second
and end_second
pair. Make sure you return an iterable stream for your loader.
Alternatively, you could use pydub
to create a directory with separate .mp3
files for each segment. Then you could use the audio.transcribe
to load the directory without needing a loader.