/*! * Copyright (c) 2026-present, Vanilagy and contributors * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { AudioSample, AudioSampleResource } from 'mediabunny'; import * as NodeAv from 'node-av'; /** * A custom `AudioSampleResource` backed by NodeAV's * [`Frame`](https://seydx.github.io/node-av/api/lib/classes/Frame.html), which in turn is backed by FFmpeg's * [`AVFrame`](https://ffmpeg.org/doxygen/2.7/structAVFrame.html). You can use this resource to create `AudioSample` * instances that are directly backed by FFmpeg's `AVFrame` without data having to be copied. * * When passed, the `Frame` is now owned by resource, meaning it takes care of closing the frame later. If you want to * keep a copy for your own use, clone the frame first. * * @group \@mediabunny/server * @public */ export declare class AvFrameAudioSampleResource extends AudioSampleResource { /** * The NodeAV [`Frame`](https://seydx.github.io/node-av/api/lib/classes/Frame.html) instance backing this resource. * Access throws if the resource has already been closed. */ get frame(): NodeAv.Frame; constructor(frame: NodeAv.Frame); /** WebCodecs sample format mapped from the underlying AvFrame. */ getFormat(): AudioSampleFormat; /** Sample rate in Hz. */ getSampleRate(): number; /** Number of audio channels. */ getNumberOfChannels(): number; /** Number of audio frames (samples per channel) in this resource. */ getNumberOfFrames(): number; /** Presentation timestamp in seconds. */ getTimestamp(): number; /** Release the underlying AvFrame; after this call the resource is unusable. */ close(): void; /** Return the raw bytes for the given plane (planar layouts have one plane per channel). */ getDataPlane(planeIndex: number): Uint8Array; } export declare const copyAudioSampleToAvFrame: (sample: AudioSample, frame: NodeAv.Frame) => void; //# sourceMappingURL=audio-sample.d.ts.map