跳到主要内容
Vane Data / API 参考

native_audio_resample_profile

native_audio_resample_profile 运行与 resample 相同的 native 解码与重采样实现,但返回计数器而不是波形。它由 native_media 扩展注册,没有 Python 形式,因此加载该扩展后即可使用,与 audio_backend 无关。

签名

text
native_audio_resample_profile(file, rate [, max_input_bytes, max_frames, max_decoded_bytes, max_output_frames, max_output_bytes])

参数

名称类型说明默认值
fileAUDIOFILE 值编码音频对象必填
rate正整数目标采样率(Hz)必填
max_input_bytes、max_frames、max_decoded_bytes、max_output_frames、max_output_bytes整数解码与输出预算同 resample 默认值

返回值与错误

返回诊断 STRUCT:

字段类型含义
setup_secondsDOUBLEcodec 与重采样器初始化耗时
decode_secondsDOUBLE解码耗时
resample_secondsDOUBLE重采样耗时
allocation_secondsDOUBLE输出分配耗时
file_read_seconds / file_read_callsDOUBLE / UBIGINT受治理的 FILE I/O 耗时与调用次数
file_bytes_readUBIGINT逻辑读取字节数
decoded_frames / output_framesUBIGINT解码与输出帧数
output_bytesUBIGINT输出采样字节数
buffer_growths / buffer_capacity_bytesUBIGINT输出缓冲扩容次数与最终容量
codec_version / resampler_versionUINTEGER构建版本整数
decoder_library / decoder_versionVARCHAR解码器标识
resampler_library / resampler_version_stringVARCHAR重采样器标识
source_sample_rateUINTEGER源采样率(Hz)

示例

query.sql
SELECT native_audio_resample_profile(audio_file('sample.wav'), 16000);

来源与相关页面