Skip to main content
Vane Data / Reference

native_audio_resample_profile

native_audio_resample_profile runs the same native decode and resample implementation as resample but returns counters instead of the waveform. It is registered by the native_media extension and has no Python form, so it is available once that extension is loaded, independent of audio_backend.

Signature

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

Parameters

NameTypeDescriptionDefault
fileAUDIOFILE valueEncoded audio objectRequired
ratePositive integerTarget sample rate in HzRequired
max_input_bytes, max_frames, max_decoded_bytes, max_output_frames, max_output_bytesIntegerDecode and output budgetsresample defaults

Returns and errors

Returns a diagnostic STRUCT:

FieldTypeMeaning
setup_secondsDOUBLECodec and resampler setup time
decode_secondsDOUBLEDecode time
resample_secondsDOUBLEResample time
allocation_secondsDOUBLEOutput allocation time
file_read_seconds / file_read_callsDOUBLE / UBIGINTGoverned FILE I/O time and call count
file_bytes_readUBIGINTLogical bytes read
decoded_frames / output_framesUBIGINTDecoded and emitted frame counts
output_bytesUBIGINTEmitted sample bytes
buffer_growths / buffer_capacity_bytesUBIGINTOutput buffer growth count and final capacity
codec_version / resampler_versionUINTEGERBuild version integers
decoder_library / decoder_versionVARCHARDecoder identity
resampler_library / resampler_version_stringVARCHARResampler identity
source_sample_rateUINTEGERSource rate in Hz

Example

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