# 处理器

## 多模态处理器[[transformers.ProcessorMixin]]

任何多模态模型都需要一个对象来编码或解码数据，该对象将多种模态（包括文本、视觉和音频）组合在一起。这由称为处理器（processor）的对象来处理，它们将两个或更多处理对象组合在一起，例如分词器（用于文本模态）、图像处理器（用于视觉）和特征提取器（用于音频）。

这些处理器继承自以下实现了保存和加载功能的基础类：

#### transformers.ProcessorMixin[[transformers.ProcessorMixin]]

```python
transformers.ProcessorMixin(*args, **kwargs)
```

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L605)

这是一个混入类，用于为所有处理器类提供保存/加载功能。

#### __调用__[[transformers.ProcessorMixin.__call__]]

```python
__call__(images: typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor'], NoneType] = None, text: str | list[str] | list[list[str]] | None = None, videos: typing.Union[list['PIL.Image.Image'], numpy.ndarray, ForwardRef('torch.Tensor'), list[numpy.ndarray], list['torch.Tensor'], list[list['PIL.Image.Image']], list[list[numpy.ndarray]], list[list['torch.Tensor']], transformers.video_utils.URL, list[transformers.video_utils.URL], list[list[transformers.video_utils.URL]], transformers.video_utils.Path, list[transformers.video_utils.Path], list[list[transformers.video_utils.Path]], NoneType] = None, audio: typing.Union[numpy.ndarray, ForwardRef('torch.Tensor'), collections.abc.Sequence[numpy.ndarray], collections.abc.Sequence['torch.Tensor'], NoneType] = None, **kwargs: *<class 'transformers.processing_utils.ProcessingKwargs'>)
```

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L671)

**参数：**

images (`Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor]]`, *可选*) : 要预处理的图像。期望输入单张图像或一批图像，其像素值范围为 0 到 255。如果传入的图像像素值在 0 到 1 之间，请设置 `do_rescale=False`。

text (`Union[str, list[str], list[list[str]]]`，*可选*)：要编码的序列或序列批次。每个序列可以是字符串或字符串列表（预分词字符串）。如果传入预分词输入，请设置 `is_split_into_words=True` 以避免与批量输入产生歧义。

videos (`Union[list[PIL.Image.Image], numpy.ndarray, torch.Tensor, list[numpy.ndarray], list[torch.Tensor], list[list[PIL.Image.Image]], list[list[numpy.ndarray]], list[list[torch.Tensor]], ~video_utils.URL, list[~video_utils.URL], list[list[~video_utils.URL]], ~video_utils.Path, list[~video_utils.Path], list[list[~video_utils.Path]]]`，*可选*)：要预处理的视频。期望输入单个视频或一批视频，其像素值范围为 0 到 255。如果传入的像素值在 0 到 1 之间，请设置 `do_rescale=False`。

audio (`Union[numpy.ndarray, torch.Tensor, collections.abc.Sequence[numpy.ndarray], collections.abc.Sequence[torch.Tensor]]`，*可选*)：要准备处理的音频或音频批次。每个音频可以是 NumPy 数组或 PyTorch 张量。对于 NumPy 数组/PyTorch 张量，每个音频的形状应为 (C, T)，其中 C 是通道数，T 是音频的采样长度。

return_mm_token_type_ids (`bool`, *kwargs*) : 是否返回多模态 token 类型 ID，以指示多模态占位符 token 的位置。

return_text_replacement_offsets (`bool`, *kwargs*) : 是否返回每个多模态占位符及其替换项的字符偏移量。

return_tensors (`str` 或 [TensorType](/docs/transformers/main/zh/internal/file_utils#transformers.TensorType)，*可选*)：如果设置，将返回特定框架的张量。可接受的值为： - `'pt'`：返回 PyTorch `torch.Tensor` 对象。 - `'np'`：返回 NumPy `np.ndarray` 对象。

- ****kwargs** ([ProcessingKwargs](/docs/transformers/main/zh/main_classes/processors#transformers.ProcessingKwargs), *可选*) : 针对每种模态（文本、图像、视频、音频）的额外处理选项。模型特定参数已在上方列出；有关支持参数的完整列表，请参阅 TypedDict 类。

#### prepare_inputs_layout[[transformers.ProcessorMixin.prepare_inputs_layout]]

```python
prepare_inputs_layout(images: typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor'], NoneType] = None, text: str | list[str] | list[list[str]] | None = None, videos: typing.Union[list['PIL.Image.Image'], numpy.ndarray, ForwardRef('torch.Tensor'), list[numpy.ndarray], list['torch.Tensor'], list[list['PIL.Image.Image']], list[list[numpy.ndarray]], list[list['torch.Tensor']], transformers.video_utils.URL, list[transformers.video_utils.URL], list[list[transformers.video_utils.URL]], transformers.video_utils.Path, list[transformers.video_utils.Path], list[list[transformers.video_utils.Path]], NoneType] = None, audio: typing.Union[numpy.ndarray, ForwardRef('torch.Tensor'), collections.abc.Sequence[numpy.ndarray], collections.abc.Sequence['torch.Tensor'], NoneType] = None, **kwargs: *<class 'transformers.processing_utils.ProcessingKwargs'>)
```

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L738)

在处理之前对输入进行归一化和预取。为多模态处理器将文本包装为列表，如果提供了 URL 则获取远程图像和音频，并确保音频被正确批处理。返回归一化后的 `(images, text, videos, audio)` 元组。

#### validate_inputs[[transformers.ProcessorMixin.validate_inputs]]

```python
validate_inputs(images: typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor'], NoneType] = None, text: str | list[str] | list[list[str]] | None = None, videos: typing.Union[list['PIL.Image.Image'], numpy.ndarray, ForwardRef('torch.Tensor'), list[numpy.ndarray], list['torch.Tensor'], list[list['PIL.Image.Image']], list[list[numpy.ndarray]], list[list['torch.Tensor']], transformers.video_utils.URL, list[transformers.video_utils.URL], list[list[transformers.video_utils.URL]], transformers.video_utils.Path, list[transformers.video_utils.Path], list[list[transformers.video_utils.Path]], NoneType] = None, audio: typing.Union[numpy.ndarray, ForwardRef('torch.Tensor'), collections.abc.Sequence[numpy.ndarray], collections.abc.Sequence['torch.Tensor'], NoneType] = None, **kwargs: *<class 'transformers.processing_utils.ProcessingKwargs'>)
```

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L767)

验证至少提供了一个输入，且未使用已弃用的关键字参数。否则将引发 `ValueError`。

当处理器需要对输入参数进行额外验证时，请重写此方法。

#### get_text_with_replacements[[transformers.ProcessorMixin.get_text_with_replacements]]

```python
get_text_with_replacements(text: list[str], images_replacements: list[str] = [], videos_replacements: list[str] = [], audio_replacements: list[str] = [])
```

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L891)

**参数：**

text (*list[str]*) : 一批原始文本字符串，每个字符串可能包含多模态占位符标记。请注意，该列表将被就地修改并返回。

images_replacements (*list[str]*，*optional*，默认为 *[]*) : 按图像在批次中出现的顺序，为每张图像展开的替换字符串。由 *self._process_images* 生成。

videos_replacements (*list[str]*，*optional*，默认为 *[]*) : 每个视频的扩展替换字符串。由 *self._process_videos* 生成。

audio_replacements (*list[str]*，*可选*，默认为 *[]*)：每个音频输入对应的扩展替换字符串。由 *self._process_audio* 生成。

**返回：** *tuple[list[str], list[dict[str, Any]]]*

一个元组，包含：
- 经过修改的 *text* 批次，其中所有占位符 token 均已展开。
- *batch_replacement_offsets*：每个批次项对应一个条目，每个条目为
包含以下键的字典列表：
- *"type"* (*str*)：模态名称 — *"image"*、*"video"* 或 *"audio"*
- *"span"* (*tuple[int, int]*): 占位符 token 的原始 *(start, end)* 字符偏移量
- *"new_span"* (*tuple[int, int]*): 占位符在展开后的字符串中的 *(start, end)* 偏移量
- *"text"* (*str*)：匹配到的原始占位符标记字符串
- *"replacement"* (*str*)：用于替换的字符串

将一批文本字符串中的多模态占位符标记替换为其展开表示形式，并返回修改后的文本以及偏移量元数据。

此方法是多模态输入的核心文本端预处理步骤。它会扫描批次中的每条文本，查找特殊标记（图像、视频、音频），并按顺序将其替换为 *self.replace_image_token* / *self.replace_video_token* / *self.replace_audio_token* 生成的预计算替换字符串。替换操作按顺序从各模态的列表中依次取用，因此例如第 i 次出现的 `self.image_token` 将被替换为 `images_replacements[i]`。

要添加一个带有占位符标记的新多模态处理器，您需要定义一个正确的 *self.image_token*，该标记与嵌入在输入文本中的标记相同，并且也用作占位符并被重复多次。然后，您需要重写 *self.replace_image_token*，以返回给定索引 *i* 处图像的替换字符串。其他所有受支持的模态也是如此。

#### create_mm_token_type_ids[[transformers.ProcessorMixin.create_mm_token_type_ids]]

```python
create_mm_token_type_ids(input_ids: list)
```

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L996)

**参数：**

input_ids (*list[list[int]]*) : 一批 token ID 序列。可能未填充（长度可变），因此预期输入是普通的 Python 列表的列表，而不是张量或形状统一的数组。

**返回：** *list[list[int]]*

一个与 `input_ids` 结构相同的列表，其中每个整数都是对应 token 的模态类型 ID。

为一批 token_id 序列构建逐 token 的模态类型 ID。

每个位置都会被分配一个整数，用于指示其所属的模态：`0` 表示常规文本，`1` 表示图像 token，`2` 表示视频 token，`3` 表示音频 token。成员关系通过将其与 `self.image_token_ids`、`self.video_token_ids` 和 `self.audio_token_ids` 进行比较来确定。

#### apply_chat_template[[transformers.ProcessorMixin.apply_chat_template]]

```python
apply_chat_template(conversation: list[dict[str, str]] | list[list[dict[str, str]]], chat_template: str | None = None, tools: list[dict] | None = None, documents: list[dict[str, str]] | None = None, add_generation_prompt: bool = False, continue_final_message: bool | str = False, return_assistant_tokens_mask: bool = False, tokenize: bool = False, return_tensors: str | transformers.utils.generic.TensorType | None = 'auto', return_dict: bool = False, load_audio_from_video: bool = False, processor_kwargs: dict | None = None, sanitize_control_tokens: bool = False, **kwargs)
```

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L2307)

**参数：**

conversation (`Union[list[Dict, [str, str]], list[list[dict[str, str]]]]`)：要格式化的对话。

chat_template (`Optional[str]`, *可选*) : 用于格式化对话的 Jinja 模板。如果未提供，则使用分词器的聊天模板。

sanitize_control_tokens (`bool`，默认为 `False`) : 是否将对话、工具、文档以及作为 `**kwargs` 传入的模板变量中找到的控制标记编码为纯文本，从而防止用户输入写入这些标记或 mm 占位符。请参阅分词器的 `apply_chat_template`。需要 `tokenize=True`。

与分词器上的 `apply_chat_template` 方法类似，该方法将 Jinja 模板应用于输入对话，将其转换为单个可分词的字符串。

输入预期采用以下格式，其中每条消息的内容是一个列表，包含文本以及可选的图像或视频输入。也可以提供图像、视频、URL 或本地路径，当 `return_dict=True` 时，将用于构建 `pixel_values`。如果未提供，则只会获得格式化后的文本，以及可选的分词后文本。

conversation = [ { "role": "user", "content": [ {"type": "image", "url": "https://www.ilankelman.org/stopsigns/australia.jpg"}, {"type": "text", "text": "请详细描述这张图片。"}, ], }, ]

### 处理 kwargs[[transformers.ProcessingKwargs]]

Processor 的 `__call__` 方法接受按模态组织的关键字参数。以下 TypedDict 类定义了每种模态可用的关键字参数。特定于模型的处理器可以继承这些类以添加或覆盖字段。

#### transformers.ProcessingKwargs[[transformers.ProcessingKwargs]]

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L459)

用于向处理器传递 kwargs 的基类。

如果某个模型具有基类中不存在的特定 kwargs，或为现有键提供了默认值，则它应拥有自己的 `ModelProcessorKwargs` 类，该类继承自 `ProcessingKwargs`，以提供该模型处理输入所需的额外类型化键。

为确保类型提示正确执行，新键必须按以下方式定义。

```python
class ModelProcessorKwargs(ProcessingKwargs, total=False):
    my_kwarg: float

class ModelProcessor(ProcessorMixin):
    valid_processor_kwargs = ModelProcessorKwargs

    @auto_docstring
    def __call__(self, images: ImageInput | None = None, ..., **kwargs: Unpack[ModelProcessorKwargs]):
        my_kwarg = kwargs.get("my_kwarg")
```

#### transformers.TextKwargs[[transformers.TextKwargs]]

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L180)

**参数：**

add_special_tokens (`bool`, *可选*) : 在编码序列时是否添加特殊标记。

padding (`bool`、`str` 或 [PaddingStrategy](/docs/transformers/main/zh/internal/file_utils#transformers.utils.PaddingStrategy)，*可选*)：启用并控制填充。

truncation (`bool`、`str` 或 [TruncationStrategy](/docs/transformers/main/zh/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy)，*可选*)：启用并控制截断。

max_length (`int`，*可选*)：用于控制截断/填充参数之一所使用的最大长度。

stride (`int`, *可选*) : 如果设置，则溢出标记将包含被截断序列末尾的一些标记。

is_split_into_words (`bool`，*可选*)：输入是否已经预先分词。

pad_to_multiple_of (`int`，*可选*)：如果设置，则将序列填充为所提供值的倍数。

return_token_type_ids (`bool`, *可选*) : 是否返回 token 类型 ID。

return_attention_mask (`bool`, *可选*) : 是否返回注意力掩码。

return_overflowing_tokens (`bool`, *可选*) : 是否返回溢出的 token 序列。

return_special_tokens_mask (`bool`, *可选*) : 是否返回特殊标记掩码信息。

return_offsets_mapping (`bool`, *可选*) : 是否返回每个 token 的 `(char_start, char_end)`。

return_length (`bool`, *可选*) : 是否返回编码后输入的长度。

verbose (`bool`, *可选*) : 是否打印更多信息和警告。

padding_side (`str`, *可选*) : 应用填充的一侧。

return_mm_token_type_ids (`bool`, *可选*) : 已弃用，请改用 `ProcessingKwargs.return_mm_token_type_ids`。是否返回多模态 token 类型 id，以指示 mm 占位符 token 的位置。

return_text_replacement_offsets (`bool`, *可选*) : 已弃用，请改用 `ProcessingKwargs.return_text_replacement_offsets`。是否返回每个 mm 占位符及其替换内容的字符偏移量。

sanitize_control_tokens (`bool`, *可选*) : 文本是否由 `mark_control_tokens` 标记：其标记的控制令牌被编码为纯文本，不会作为 mm 占位符展开。由 `apply_chat_template(..., sanitize_control_tokens=True)` 设置。

return_tensors (`str` 或 [TensorType](/docs/transformers/main/zh/internal/file_utils#transformers.TensorType)，*可选*)：如果设置，将返回特定框架的张量。可接受的值为：- `'pt'`：返回 PyTorch `torch.Tensor` 对象。- `'np'`：返回 NumPy `np.ndarray` 对象。

用于文本处理的关键词参数。有关扩展文档，请查看 tokenization_utils_base 的相关方法和文档字符串。

#### transformers.ImagesKwargs[[transformers.ImagesKwargs]]

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L255)

**参数：**

do_convert_rgb (`bool`) : 是否将图像转换为 RGB 格式。

do_resize (`bool`，*可选*)：是否调整图像大小。

size (`dict[str, int]`，*可选*)：使用受支持的尺寸字典之一进行缩放。像素面积范围使用 `{"min_pixels": int, "max_pixels": int}`。

default_to_square (`bool`，*可选*，默认为 `self.default_to_square`)：当 size 为 int 时，是否在调整大小时默认使用正方形。

crop_size (`dict[str, int]`，*可选*)：应用中心裁剪时所需的输出尺寸。

resample (`PILImageResampling`，*可选*)：在调整图像大小时使用的重采样滤波器。

do_rescale (`bool`, *可选*) : 是否按指定的缩放比例 `rescale_factor` 对图像进行重新缩放。

rescale_factor (`int` 或 `float`，*可选*)：如果重新缩放图像，则使用的缩放因子。

do_normalize (`bool`, *可选*) : 是否对图像进行归一化。

image_mean (`float` or `list[float] or tuple[float, float, float]`, *optional*) : Mean to use if normalizing the image.

image_std (`float` or `list[float] or tuple[float, float, float]`, *optional*) : Standard deviation to use if normalizing the image.

do_pad (`bool`, *可选*) : 是否对批次中的图像进行填充。

pad_size (`dict[str, int]`，*可选*)：将图像填充到的尺寸 `{"height": int, "width" int}`。

do_center_crop (`bool`，*可选*)：是否对图像进行居中裁剪。

data_format (`ChannelDimension` 或 `str`，*可选*)：输出图像的通道维度格式。

input_data_format (`ChannelDimension` 或 `str`，*可选*)：输入图像的通道维度格式。

device (`Union[str, torch.Tensor]`，*可选*)：用于处理的设备（例如 "cpu"、"cuda"），仅对 torchvision 后端有效。

return_tensors (`str` 或 [TensorType](/docs/transformers/main/zh/internal/file_utils#transformers.TensorType)，*可选*)：如果设置，将返回特定框架的张量。可接受的值为：- `'pt'`：返回 PyTorch `torch.Tensor` 对象。- `'np'`：返回 NumPy `np.ndarray` 对象。

disable_grouping (`bool`, *可选*) : 是否在处理时按形状对图像进行分组，仅适用于 torchvision 后端。

image_seq_length (`int`, *可选*) : 输入中每张图片所使用的图像 token 数量。为向后兼容而添加，但在未来的模型中，应将其设置为处理器的属性。

图像处理的关键词参数。如需扩展文档，请查看相应 ImageProcessor 类的方法及文档字符串。

#### transformers.VideosKwargs[[transformers.VideosKwargs]]

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L329)

**参数：**

do_convert_rgb (`bool`) : 是否将视频转换为 RGB 格式。

do_resize (`bool`) : 是否调整视频大小。

size (`dict[str, int]`，*可选*)：将输入的较短边调整为 `size["shortest_edge"]`。

default_to_square (`bool`，*可选*，默认为 `self.default_to_square`)：当 size 为 int 时，是否在调整大小时默认使用正方形。

resample (`PILImageResampling`，*可选*)：调整视频大小时使用的重采样滤波器。

do_rescale (`bool`，*可选*)：是否按指定的缩放因子 `rescale_factor` 对视频进行重新缩放。

rescale_factor (`int` 或 `float`，*可选*)：如果重新缩放视频，要使用的缩放因子。

do_normalize (`bool`，*可选*)：是否对视频进行归一化。

image_mean (`float` or `list[float] or tuple[float, float, float]`, *optional*) : Mean to use if normalizing the video.

image_std (`float` or `list[float] or tuple[float, float, float]`, *optional*) : Standard deviation to use if normalizing the video.

do_center_crop (`bool`，*可选*)：是否对视频进行居中裁剪。

do_pad (`bool`, *可选*) : 是否对批次中的图像进行填充。

do_sample_frames (`bool`，*可选*)：是否在处理前从视频中采样帧，还是处理整个视频。

video_metadata (`Union[VideoMetadata, dict]`，*可选*)：视频的元数据，包含总时长、帧率和总帧数等信息。

num_frames (`int`, *可选*) : 当 `do_sample_frames=True` 时，要采样的最大帧数。

fps (`int` 或 `float`，*可选*) : 当 `do_sample_frames=True` 时，每秒采样的目标帧数。

crop_size (`dict[str, int]`，*可选*)：应用中心裁剪时所需的输出尺寸。

data_format (`ChannelDimension` 或 `str`，*可选*)：输出视频的通道维度格式。

input_data_format (`ChannelDimension` 或 `str`，*可选*)：输入视频的通道维度格式。

device (`Union[str, torch.Tensor]`，*可选*)：用于处理的设备（例如 "cpu"、"cuda"），仅对快速图像处理相关。

return_metadata (`bool`, *可选*) : 是否返回视频元数据。

return_tensors (`str` 或 [TensorType](/docs/transformers/main/zh/internal/file_utils#transformers.TensorType)，*可选*)：如果设置，将返回特定框架的张量。可接受的值为：- `'pt'`：返回 PyTorch `torch.Tensor` 对象。- `'np'`：返回 NumPy `np.ndarray` 对象。

用于视频处理的关键词参数。

#### transformers.AudioKwargs[[transformers.AudioKwargs]]

[来源](https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L406)

**参数：**

sampling_rate (`int`, *可选*) : `raw_speech` 输入的采样率。

raw_speech (`np.ndarray`、`list[float]`、`list[np.ndarray]`、`list[list[float]]`)：需要填充的序列或序列批次。每个序列可以是 numpy 数组、浮点值列表、numpy 数组列表或浮点值列表的列表。必须是单声道音频，而非立体声，即每个时间步仅包含一个浮点值。

padding (`bool`、`str` 或 [PaddingStrategy](/docs/transformers/main/zh/internal/file_utils#transformers.utils.PaddingStrategy)，*可选*) : 选择一种策略来填充返回的序列（根据模型的填充方向和填充索引），可选策略如下： - `True` 或 `'longest'`：填充至批次中最长的序列（如果仅提供单个序列，则不进行填充）。 - `'max_length'`：填充至由参数 `max_length` 指定的最大长度，或者如果未提供该参数，则填充至模型可接受的最大输入长度。 - `False` 或 `'do_not_pad'`

max_length (`int`, *可选*) : 返回列表的最大长度，以及可选的填充长度（见上文）。

truncation (`bool`，*可选*)：启用截断，将长度超过 *max_length* 的输入序列截断为 *max_length*。

pad_to_multiple_of (`int`，*可选*)：如果设置，则将序列填充为所提供值的倍数。

return_attention_mask (`bool`，*可选*)：是否让 [__call__()](/docs/transformers/main/zh/model_doc/audio-spectrogram-transformer#transformers.ASTFeatureExtractor.__call__) 返回 `attention_mask`。

device (`str` 或 `torch.device`，*可选*)：用于计算音频特征的设备（例如 "cpu"、"cuda"），仅适用于使用 torch 计算特征的 feature extractor。

return_tensors (`str` 或 [TensorType](/docs/transformers/main/zh/internal/file_utils#transformers.TensorType)，*可选*)：如果设置，将返回特定框架的张量。可接受的值为：- `'pt'`：返回 PyTorch `torch.Tensor` 对象。- `'np'`：返回 NumPy `np.ndarray` 对象。

load_audio_backend (`str`, *可选*) : `load_audio()` 用于解码/重采样 `apply_chat_template` 中通过 URL/路径引用的音频的后端。取值为 `"auto"`、`"torchcodec"`、`"soundfile"` 或 `"torchaudio"` 之一（`"librosa"` 是 `"soundfile"` 的已弃用别名）。

用于音频处理的关键词参数。

