data_juicer.ops.mapper.audio_ffmpeg_wrapped_mapper module¶
- class data_juicer.ops.mapper.audio_ffmpeg_wrapped_mapper.AudioFFmpegWrappedMapper(filter_name: str | None = None, filter_kwargs: Dict | None = None, global_args: List[str] | None = None, capture_stderr: bool = True, overwrite_output: bool = True, save_dir: str = None, *args, **kwargs)[源代码]¶
基类:
Mapper
Wraps FFmpeg audio filters for processing audio files in a dataset.
This operator applies specified FFmpeg audio filters to the audio files in the dataset. It supports passing custom filter parameters and global arguments to the FFmpeg command line. The processed audio files are saved to a specified directory or the same directory as the input files if no save directory is provided. The DJ_PRODUCED_DATA_DIR environment variable can also be used to set the save directory. If no filter name is provided, the audio files remain unmodified. The operator updates the source file paths in the dataset after processing.
- __init__(filter_name: str | None = None, filter_kwargs: Dict | None = None, global_args: List[str] | None = None, capture_stderr: bool = True, overwrite_output: bool = True, save_dir: str = None, *args, **kwargs)[源代码]¶
Initialization method.
- 参数:
filter_name -- ffmpeg audio filter name.
filter_kwargs -- keyword-arguments passed to ffmpeg filter.
global_args -- list-arguments passed to ffmpeg command-line.
capture_stderr -- whether to capture stderr.
overwrite_output -- whether to overwrite output file.
save_dir -- The directory where generated audio files will be stored. If not specified, outputs will be saved in the same directory as their corresponding input files. This path can alternatively be defined by setting the DJ_PRODUCED_DATA_DIR environment variable.
args -- extra args
kwargs -- extra args