Defined in avcodec.h
Encodes an audio frame from samples
into buf
.
The avcodec_encode_audio() function encodes an audio frame from the input buffer samples
. To encode it, it makes use of the audio codec which was coupled with avctx
using avcodec_open(). The resulting encoded frame is stored in output buffer buf
.
Note: The output buffer should be at least FF_MIN_BUFFER_SIZE
bytes large.
int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples);
AVCodecContext *avctx
avctx the AVCodecContext codec context.
uint8_t *buf
The output buffer.
int buf_size
The output buffer size.
const short *samples
The input buffer containing the samples.
On error a negative value is returned, on succes zero or the number of bytes used from the input buffer.