1cdef extern from "libavutil/samplefmt.h" nogil:
2
3    cdef enum AVSampleFormat:
4        AV_SAMPLE_FMT_NONE
5        AV_SAMPLE_FMT_U8
6        AV_SAMPLE_FMT_S16
7        AV_SAMPLE_FMT_S32
8        AV_SAMPLE_FMT_FLT
9        AV_SAMPLE_FMT_DBL
10        AV_SAMPLE_FMT_U8P
11        AV_SAMPLE_FMT_S16P
12        AV_SAMPLE_FMT_S32P
13        AV_SAMPLE_FMT_FLTP
14        AV_SAMPLE_FMT_DBLP
15        AV_SAMPLE_FMT_NB # Number.
16
17    # Find by name.
18    cdef AVSampleFormat av_get_sample_fmt(char* name)
19
20    # Inspection.
21    cdef char * av_get_sample_fmt_name(AVSampleFormat sample_fmt)
22    cdef int    av_get_bytes_per_sample(AVSampleFormat sample_fmt)
23    cdef int    av_sample_fmt_is_planar(AVSampleFormat sample_fmt)
24
25    # Alternative forms.
26    cdef AVSampleFormat av_get_packed_sample_fmt(AVSampleFormat sample_fmt)
27    cdef AVSampleFormat av_get_planar_sample_fmt(AVSampleFormat sample_fmt)
28
29    cdef int av_samples_alloc(
30        uint8_t** audio_data,
31        int* linesize,
32        int nb_channels,
33        int nb_samples,
34        AVSampleFormat sample_fmt,
35        int align
36    )
37
38    cdef int av_samples_get_buffer_size(
39        int *linesize,
40        int nb_channels,
41        int nb_samples,
42        AVSampleFormat sample_fmt,
43        int align
44    )
45
46
47    cdef int av_samples_fill_arrays(
48        uint8_t **audio_data,
49        int *linesize,
50        const uint8_t *buf,
51        int nb_channels,
52        int nb_samples,
53        AVSampleFormat sample_fmt,
54        int align
55    )
56
57    cdef int av_samples_set_silence(
58        uint8_t **audio_data,
59        int offset,
60        int nb_samples,
61        int nb_channels,
62        AVSampleFormat sample_fmt
63    )
64