/* automatically generated by rust-bindgen 0.72.1 */

pub const __bool_true_false_are_defined: u32 = 1;
pub const true_: u32 = 1;
pub const false_: u32 = 0;
pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const __GLIBC_USE_ISOC2X: u32 = 0;
pub const __USE_ISOC11: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
pub const _POSIX_SOURCE: u32 = 1;
pub const _POSIX_C_SOURCE: u32 = 200809;
pub const __USE_POSIX: u32 = 1;
pub const __USE_POSIX2: u32 = 1;
pub const __USE_POSIX199309: u32 = 1;
pub const __USE_POSIX199506: u32 = 1;
pub const __USE_XOPEN2K: u32 = 1;
pub const __USE_XOPEN2K8: u32 = 1;
pub const _ATFILE_SOURCE: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const __TIMESIZE: u32 = 64;
pub const __USE_MISC: u32 = 1;
pub const __USE_ATFILE: u32 = 1;
pub const __USE_FORTIFY_LEVEL: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
pub const __GLIBC_USE_C2X_STRTOL: u32 = 0;
pub const _STDC_PREDEF_H: u32 = 1;
pub const __STDC_IEC_559__: u32 = 1;
pub const __STDC_IEC_60559_BFP__: u32 = 201404;
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404;
pub const __STDC_ISO_10646__: u32 = 201706;
pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 39;
pub const _SYS_CDEFS_H: u32 = 1;
pub const __glibc_c99_flexarr_available: u32 = 1;
pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
pub const __HAVE_GENERIC_SELECTION: u32 = 1;
pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
pub const _BITS_TYPES_H: u32 = 1;
pub const _BITS_TYPESIZES_H: u32 = 1;
pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
pub const __INO_T_MATCHES_INO64_T: u32 = 1;
pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
pub const __STATFS_MATCHES_STATFS64: u32 = 1;
pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
pub const __FD_SETSIZE: u32 = 1024;
pub const _BITS_TIME64_H: u32 = 1;
pub const _BITS_WCHAR_H: u32 = 1;
pub const _BITS_STDINT_INTN_H: u32 = 1;
pub const _BITS_STDINT_UINTN_H: u32 = 1;
pub const _BITS_STDINT_LEAST_H: u32 = 1;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
pub const INT8_MAX: u32 = 127;
pub const INT16_MAX: u32 = 32767;
pub const INT32_MAX: u32 = 2147483647;
pub const UINT8_MAX: u32 = 255;
pub const UINT16_MAX: u32 = 65535;
pub const UINT32_MAX: u32 = 4294967295;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST8_MAX: u32 = 127;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const INT_FAST8_MIN: i32 = -128;
pub const INT_FAST16_MIN: i64 = -9223372036854775808;
pub const INT_FAST32_MIN: i64 = -9223372036854775808;
pub const INT_FAST8_MAX: u32 = 127;
pub const INT_FAST16_MAX: u64 = 9223372036854775807;
pub const INT_FAST32_MAX: u64 = 9223372036854775807;
pub const UINT_FAST8_MAX: u32 = 255;
pub const UINT_FAST16_MAX: i32 = -1;
pub const UINT_FAST32_MAX: i32 = -1;
pub const INTPTR_MIN: i64 = -9223372036854775808;
pub const INTPTR_MAX: u64 = 9223372036854775807;
pub const UINTPTR_MAX: i32 = -1;
pub const PTRDIFF_MIN: i64 = -9223372036854775808;
pub const PTRDIFF_MAX: u64 = 9223372036854775807;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const SIZE_MAX: i32 = -1;
pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 4294967295;
pub const _UCHAR_H: u32 = 1;
pub const __mbstate_t_defined: u32 = 1;
pub const ____mbstate_t_defined: u32 = 1;
pub const PIPER_OK: u32 = 0;
pub const PIPER_DONE: u32 = 1;
pub const PIPER_ERR_GENERIC: i32 = -1;
pub type wchar_t = ::std::os::raw::c_int;
#[repr(C)]
#[repr(align(16))]
#[derive(Debug, Copy, Clone)]
pub struct max_align_t {
    pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
    pub __bindgen_padding_0: u64,
    pub __clang_max_align_nonce2: u128,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of max_align_t"][::std::mem::size_of::<max_align_t>() - 32usize];
    ["Alignment of max_align_t"][::std::mem::align_of::<max_align_t>() - 16usize];
    ["Offset of field: max_align_t::__clang_max_align_nonce1"]
        [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize];
    ["Offset of field: max_align_t::__clang_max_align_nonce2"]
        [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 16usize];
};
pub type __u_char = ::std::os::raw::c_uchar;
pub type __u_short = ::std::os::raw::c_ushort;
pub type __u_int = ::std::os::raw::c_uint;
pub type __u_long = ::std::os::raw::c_ulong;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
pub type __int_least8_t = __int8_t;
pub type __uint_least8_t = __uint8_t;
pub type __int_least16_t = __int16_t;
pub type __uint_least16_t = __uint16_t;
pub type __int_least32_t = __int32_t;
pub type __uint_least32_t = __uint32_t;
pub type __int_least64_t = __int64_t;
pub type __uint_least64_t = __uint64_t;
pub type __quad_t = ::std::os::raw::c_long;
pub type __u_quad_t = ::std::os::raw::c_ulong;
pub type __intmax_t = ::std::os::raw::c_long;
pub type __uintmax_t = ::std::os::raw::c_ulong;
pub type __dev_t = ::std::os::raw::c_ulong;
pub type __uid_t = ::std::os::raw::c_uint;
pub type __gid_t = ::std::os::raw::c_uint;
pub type __ino_t = ::std::os::raw::c_ulong;
pub type __ino64_t = ::std::os::raw::c_ulong;
pub type __mode_t = ::std::os::raw::c_uint;
pub type __nlink_t = ::std::os::raw::c_ulong;
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
pub type __pid_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __fsid_t {
    pub __val: [::std::os::raw::c_int; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of __fsid_t"][::std::mem::size_of::<__fsid_t>() - 8usize];
    ["Alignment of __fsid_t"][::std::mem::align_of::<__fsid_t>() - 4usize];
    ["Offset of field: __fsid_t::__val"][::std::mem::offset_of!(__fsid_t, __val) - 0usize];
};
pub type __clock_t = ::std::os::raw::c_long;
pub type __rlim_t = ::std::os::raw::c_ulong;
pub type __rlim64_t = ::std::os::raw::c_ulong;
pub type __id_t = ::std::os::raw::c_uint;
pub type __time_t = ::std::os::raw::c_long;
pub type __useconds_t = ::std::os::raw::c_uint;
pub type __suseconds_t = ::std::os::raw::c_long;
pub type __suseconds64_t = ::std::os::raw::c_long;
pub type __daddr_t = ::std::os::raw::c_int;
pub type __key_t = ::std::os::raw::c_int;
pub type __clockid_t = ::std::os::raw::c_int;
pub type __timer_t = *mut ::std::os::raw::c_void;
pub type __blksize_t = ::std::os::raw::c_long;
pub type __blkcnt_t = ::std::os::raw::c_long;
pub type __blkcnt64_t = ::std::os::raw::c_long;
pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
pub type __fsword_t = ::std::os::raw::c_long;
pub type __ssize_t = ::std::os::raw::c_long;
pub type __syscall_slong_t = ::std::os::raw::c_long;
pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
pub type __loff_t = __off64_t;
pub type __caddr_t = *mut ::std::os::raw::c_char;
pub type __intptr_t = ::std::os::raw::c_long;
pub type __socklen_t = ::std::os::raw::c_uint;
pub type __sig_atomic_t = ::std::os::raw::c_int;
pub type int_least8_t = __int_least8_t;
pub type int_least16_t = __int_least16_t;
pub type int_least32_t = __int_least32_t;
pub type int_least64_t = __int_least64_t;
pub type uint_least8_t = __uint_least8_t;
pub type uint_least16_t = __uint_least16_t;
pub type uint_least32_t = __uint_least32_t;
pub type uint_least64_t = __uint_least64_t;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::os::raw::c_long;
pub type int_fast32_t = ::std::os::raw::c_long;
pub type int_fast64_t = ::std::os::raw::c_long;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_ulong;
pub type uint_fast32_t = ::std::os::raw::c_ulong;
pub type uint_fast64_t = ::std::os::raw::c_ulong;
pub type intmax_t = __intmax_t;
pub type uintmax_t = __uintmax_t;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct __mbstate_t {
    pub __count: ::std::os::raw::c_int,
    pub __value: __mbstate_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union __mbstate_t__bindgen_ty_1 {
    pub __wch: ::std::os::raw::c_uint,
    pub __wchb: [::std::os::raw::c_char; 4usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of __mbstate_t__bindgen_ty_1"]
        [::std::mem::size_of::<__mbstate_t__bindgen_ty_1>() - 4usize];
    ["Alignment of __mbstate_t__bindgen_ty_1"]
        [::std::mem::align_of::<__mbstate_t__bindgen_ty_1>() - 4usize];
    ["Offset of field: __mbstate_t__bindgen_ty_1::__wch"]
        [::std::mem::offset_of!(__mbstate_t__bindgen_ty_1, __wch) - 0usize];
    ["Offset of field: __mbstate_t__bindgen_ty_1::__wchb"]
        [::std::mem::offset_of!(__mbstate_t__bindgen_ty_1, __wchb) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of __mbstate_t"][::std::mem::size_of::<__mbstate_t>() - 8usize];
    ["Alignment of __mbstate_t"][::std::mem::align_of::<__mbstate_t>() - 4usize];
    ["Offset of field: __mbstate_t::__count"]
        [::std::mem::offset_of!(__mbstate_t, __count) - 0usize];
    ["Offset of field: __mbstate_t::__value"]
        [::std::mem::offset_of!(__mbstate_t, __value) - 4usize];
};
pub type mbstate_t = __mbstate_t;
pub type char16_t = __uint_least16_t;
pub type char32_t = __uint_least32_t;
unsafe extern "C" {
    pub fn mbrtoc16(
        __pc16: *mut char16_t,
        __s: *const ::std::os::raw::c_char,
        __n: usize,
        __p: *mut mbstate_t,
    ) -> usize;
}
unsafe extern "C" {
    pub fn c16rtomb(
        __s: *mut ::std::os::raw::c_char,
        __c16: char16_t,
        __ps: *mut mbstate_t,
    ) -> usize;
}
unsafe extern "C" {
    pub fn mbrtoc32(
        __pc32: *mut char32_t,
        __s: *const ::std::os::raw::c_char,
        __n: usize,
        __p: *mut mbstate_t,
    ) -> usize;
}
unsafe extern "C" {
    pub fn c32rtomb(
        __s: *mut ::std::os::raw::c_char,
        __c32: char32_t,
        __ps: *mut mbstate_t,
    ) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct piper_synthesizer {
    _unused: [u8; 0],
}
#[doc = " \\brief Chunk of synthesized audio samples."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct piper_audio_chunk {
    #[doc = " \\brief Raw samples returned from the voice model."]
    pub samples: *const f32,
    #[doc = " \\brief Number of samples in the audio chunk."]
    pub num_samples: usize,
    #[doc = " \\brief Sample rate in Hertz."]
    pub sample_rate: ::std::os::raw::c_int,
    #[doc = " \\brief True if this is the last audio chunk."]
    pub is_last: bool,
    #[doc = " \\brief Phoneme codepoints that produced this audio chunk, aligned with ids.\n\n Phonemes will look like [p1, p1, 0, p2, p2, 0, ...] where the same phoneme\n codepoint is repeated for each id from that phoneme (usually just one id\n plus pad).\n\n Groups of repeated codepoints are separated by a 0 so that alignments can\n be attributed to the correct phoneme. This is accomplished by:\n\n 1. Read N (repeated) codepoints from phonemes until a 0 is reached (or end)\n 2. The next N phoneme ids correspond to that phoneme\n 3. The next N alignments (sample counts) correspond to that phoneme\n 4. Advance your iterators in the phoneme id and alignment arrays by N\n 5. Repeat"]
    pub phonemes: *const char32_t,
    #[doc = " \\brief Number of codepoints in phonemes."]
    pub num_phonemes: usize,
    #[doc = " \\brief Phoneme ids that produced this audio chunk.\n\n Ids will look like [1, 0, id1, 0, id2, 0, ..., 2] where:\n 0 = pad\n 1 = beginning of sentence\n 2 = end of sentence"]
    pub phoneme_ids: *const ::std::os::raw::c_int,
    #[doc = " \\brief Number of ids in phoneme_ids."]
    pub num_phoneme_ids: usize,
    #[doc = " \\brief Audio sample count for each phoneme id.\n\n This includes the meta ids:\n 0 = pad\n 1 = beginning of sentence\n 2 = end of sentence\n\n Use the phonemes array to align these sample counts with actual phonemes."]
    pub alignments: *const ::std::os::raw::c_int,
    #[doc = " \\brief Number of alignments.\n\n This should be the same as num_phoneme_ids."]
    pub num_alignments: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of piper_audio_chunk"][::std::mem::size_of::<piper_audio_chunk>() - 72usize];
    ["Alignment of piper_audio_chunk"][::std::mem::align_of::<piper_audio_chunk>() - 8usize];
    ["Offset of field: piper_audio_chunk::samples"]
        [::std::mem::offset_of!(piper_audio_chunk, samples) - 0usize];
    ["Offset of field: piper_audio_chunk::num_samples"]
        [::std::mem::offset_of!(piper_audio_chunk, num_samples) - 8usize];
    ["Offset of field: piper_audio_chunk::sample_rate"]
        [::std::mem::offset_of!(piper_audio_chunk, sample_rate) - 16usize];
    ["Offset of field: piper_audio_chunk::is_last"]
        [::std::mem::offset_of!(piper_audio_chunk, is_last) - 20usize];
    ["Offset of field: piper_audio_chunk::phonemes"]
        [::std::mem::offset_of!(piper_audio_chunk, phonemes) - 24usize];
    ["Offset of field: piper_audio_chunk::num_phonemes"]
        [::std::mem::offset_of!(piper_audio_chunk, num_phonemes) - 32usize];
    ["Offset of field: piper_audio_chunk::phoneme_ids"]
        [::std::mem::offset_of!(piper_audio_chunk, phoneme_ids) - 40usize];
    ["Offset of field: piper_audio_chunk::num_phoneme_ids"]
        [::std::mem::offset_of!(piper_audio_chunk, num_phoneme_ids) - 48usize];
    ["Offset of field: piper_audio_chunk::alignments"]
        [::std::mem::offset_of!(piper_audio_chunk, alignments) - 56usize];
    ["Offset of field: piper_audio_chunk::num_alignments"]
        [::std::mem::offset_of!(piper_audio_chunk, num_alignments) - 64usize];
};
#[doc = " \\brief Options for synthesis.\n\n \\sa \\ref piper_default_synthesize_options"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct piper_synthesize_options {
    #[doc = " \\brief Id of speaker to use (multi-speaker models only).\n\n Id 0 is the first speaker."]
    pub speaker_id: ::std::os::raw::c_int,
    #[doc = " \\brief How fast the text is spoken.\n\n A length scale of 0.5 means to speak twice as fast.\n A length scale of 2.0 means to speak twice as slow.\n The default is 1.0."]
    pub length_scale: f32,
    #[doc = " \\brief Controls how much noise is added during synthesis.\n\n The best value depends on the voice.\n For single speaker models, a value of 0.667 is usually good.\n For multi-speaker models, a value of 0.333 is usually good."]
    pub noise_scale: f32,
    #[doc = " \\brief Controls how much phonemes vary in length during synthesis.\n\n The best value depends on the voice.\n For single speaker models, a value of 0.8 is usually good.\n For multi-speaker models, a value of 0.333 is usually good."]
    pub noise_w_scale: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of piper_synthesize_options"]
        [::std::mem::size_of::<piper_synthesize_options>() - 16usize];
    ["Alignment of piper_synthesize_options"]
        [::std::mem::align_of::<piper_synthesize_options>() - 4usize];
    ["Offset of field: piper_synthesize_options::speaker_id"]
        [::std::mem::offset_of!(piper_synthesize_options, speaker_id) - 0usize];
    ["Offset of field: piper_synthesize_options::length_scale"]
        [::std::mem::offset_of!(piper_synthesize_options, length_scale) - 4usize];
    ["Offset of field: piper_synthesize_options::noise_scale"]
        [::std::mem::offset_of!(piper_synthesize_options, noise_scale) - 8usize];
    ["Offset of field: piper_synthesize_options::noise_w_scale"]
        [::std::mem::offset_of!(piper_synthesize_options, noise_w_scale) - 12usize];
};
unsafe extern "C" {
    #[doc = " \\brief Create a Piper text-to-speech synthesizer from a voice model.\n\n \\param model_path path to ONNX voice model file.\n\n \\param config_path path to JSON voice config file or NULL if it's the\n model_path + .json.\n\n \\param espeak_data_path path to the espeak-ng data\n directory.\n\n \\return a Piper text-to-speech synthesizer for the voice model."]
    pub fn piper_create(
        model_path: *const ::std::os::raw::c_char,
        config_path: *const ::std::os::raw::c_char,
        espeak_data_path: *const ::std::os::raw::c_char,
        use_cuda: bool,
    ) -> *mut piper_synthesizer;
}
unsafe extern "C" {
    #[doc = " \\brief Free resources for Piper synthesizer.\n\n \\param synth Piper synthesizer."]
    pub fn piper_free(synth: *mut piper_synthesizer);
}
unsafe extern "C" {
    #[doc = " \\brief Get the default synthesis options for a Piper synthesizer.\n\n \\param synth Piper synthesizer.\n\n \\return synthesis options from voice config."]
    pub fn piper_default_synthesize_options(
        synth: *mut piper_synthesizer,
    ) -> piper_synthesize_options;
}
unsafe extern "C" {
    #[doc = " \\brief Start text-to-speech synthesis.\n\n \\param synth Piper synthesizer.\n\n \\param text text to synthesize into audio.\n\n \\param options synthesis options or NULL for defaults.\n\n \\sa \\ref piper_synthesize_next\n\n \\return PIPER_OK or error code."]
    pub fn piper_synthesize_start(
        synth: *mut piper_synthesizer,
        text: *const ::std::os::raw::c_char,
        options: *const piper_synthesize_options,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    #[doc = " \\brief Synthesize next chunk of audio.\n\n \\param synth Piper synthesizer.\n\n \\param chunk audio chunk to fill.\n\n piper_synthesize_start must be called before this function.\n Each call to piper_synthesize_next will fill the audio chunk, invalidating\n the memory of the previous chunk.\n The final audio chunk will have is_last = true.\n A return value of PIPER_DONE indicates that synthesis is complete.\n\n \\sa \\ref piper_synthesize_start\n\n \\return PIPER_DONE when complete, otherwise PIPER_OK or error code."]
    pub fn piper_synthesize_next(
        synth: *mut piper_synthesizer,
        chunk: *mut piper_audio_chunk,
    ) -> ::std::os::raw::c_int;
}
