pyflink.multimodal.expression.AudioExpressionAccessor.split_by_timestamp#
- AudioExpressionAccessor.split_by_timestamp(timestamps: Union[pyflink.table.expression.Expression, List[Union[Dict[str, int], Sequence[int], pyflink.multimodal.expression._TimestampRow]], Tuple[Union[Dict[str, int], Sequence[int], pyflink.multimodal.expression._TimestampRow], ...]], *, segment_type: Literal['audio', 'ref'] = 'audio', concurrency: Optional[int] = None) pyflink.dataframe.udf.DataFrameUDTFCall[source]#
Split audio by explicit timestamp ranges.
Equivalent to
audio_split_by_timestamp(). See that function for full parameter details.- Parameters
timestamps – Timestamp ranges in milliseconds, either a Python literal sequence or a DataFrame column expression.
segment_type –
"audio"for waveform segments or"ref"for lazy reference segments.concurrency – Optional execution concurrency for this operation.
Noneuses the framework default.
- Returns
A DataFrame UDTF call for
join_lateral. Alias the output as one segment column before consuming it downstream.
- Examples::
>>> ranges = [{"start_ms": 100, "end_ms": 350}] >>> segments = df.join_lateral( ... col("waveform").audio.split_by_timestamp( ... timestamps=ranges, ... ).alias("segment") ... ) >>> segments = df.join_lateral( ... col("waveform").audio.split_by_timestamp( ... col("ranges"), ... ).alias("segment") ... )