Initial commit: TXW82x FPV v2.7.0.7-42229 SDK + project sources
This commit is contained in:
213
sdk/include/lib/audio/audio_code/audio_code.h
Normal file
213
sdk/include/lib/audio/audio_code/audio_code.h
Normal file
@@ -0,0 +1,213 @@
|
||||
#ifndef _AUDIO_CODE_H_
|
||||
#define _AUDIO_CODE_H_
|
||||
|
||||
#include "typesdef.h"
|
||||
#include "osal/string.h"
|
||||
#include "osal/sleep.h"
|
||||
|
||||
#define AUCODER_NO_RUN 0
|
||||
#define AUCODER_RUN_IN_CPU0 1
|
||||
#define AUCODER_RUN_IN_CPU1 2
|
||||
|
||||
#ifndef AAC_ENC_CTRL
|
||||
#define AAC_ENC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef AAC_DEC_CTRL
|
||||
#define AAC_DEC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef AMRNB_DEC_CTRL
|
||||
#define AMRNB_DEC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef AMRWB_DEC_CTRL
|
||||
#define AMRWB_DEC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef MP3_DEC_CTRL
|
||||
#define MP3_DEC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef ALAW_ENC_CTRL
|
||||
#define ALAW_ENC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef ALAW_DEC_CTRL
|
||||
#define ALAW_DEC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef ULAW_ENC_CTRL
|
||||
#define ULAW_ENC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef ULAW_DEC_CTRL
|
||||
#define ULAW_DEC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef OPUS_ENC_CTRL
|
||||
#define OPUS_ENC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
#ifndef OPUS_DEC_CTRL
|
||||
#define OPUS_DEC_CTRL AUCODER_NO_RUN
|
||||
#endif
|
||||
|
||||
#define AUCODE_INFO os_printf
|
||||
|
||||
#define aucode_memcpy os_memcpy
|
||||
#define aucode_memset os_memset
|
||||
#define aucode_memmove os_memmove
|
||||
|
||||
#define AUCODE_OK 0
|
||||
#define AUCODE_ERR -1
|
||||
|
||||
#define MAX_AUCODER_NUM 10
|
||||
|
||||
#if OPUS_ENC_CTRL
|
||||
#define AUCODE_STACK_SIZE 10240
|
||||
#elif OPUS_DEC_CTRL
|
||||
#define AUCODE_STACK_SIZE 4096
|
||||
#else
|
||||
#define AUCODE_STACK_SIZE 0
|
||||
#endif
|
||||
|
||||
enum {
|
||||
AAC_ENC = 1,
|
||||
AAC_DEC,
|
||||
AMRNB_DEC,
|
||||
AMRWB_DEC,
|
||||
MP3_DEC,
|
||||
ALAW_ENC,
|
||||
ALAW_DEC,
|
||||
ULAW_ENC,
|
||||
ULAW_DEC,
|
||||
OPUS_ENC,
|
||||
OPUS_DEC,
|
||||
};
|
||||
|
||||
enum {
|
||||
codec_start = BIT(0),
|
||||
codec_finish = BIT(1),
|
||||
coder_close = BIT(2),
|
||||
coder_exit = BIT(3),
|
||||
decode_plc = BIT(4),
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
void *coder;
|
||||
void *priv;
|
||||
uint8_t coder_type;
|
||||
uint8_t fade_type;
|
||||
uint32_t frame_nsamples;
|
||||
} AUCODE_HDL;
|
||||
|
||||
typedef struct {
|
||||
int32_t frame_bytes;
|
||||
uint32_t samplerate;
|
||||
uint32_t channels;
|
||||
} AUCODE_FRAME_INFO;
|
||||
|
||||
typedef int32_t (*audio_encode_func)(void *coder, int16_t *in_data, uint32_t samples, uint8_t *out_data);
|
||||
typedef int32_t (*audio_decode_func)(void *coder, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info);
|
||||
typedef int32_t (*decode_plc_func)(void *coder, int16_t *out_data, uint32_t samples);
|
||||
typedef int32_t (*aucoder_close_func)(void *coder);
|
||||
|
||||
typedef void *(*AUCODE_MALLOC)(int size);
|
||||
typedef void *(*AUCODE_ZALLOC)(int size);
|
||||
typedef void *(*AUCODE_CALLOC)(int nmemb, int size);
|
||||
typedef void *(*AUCODE_REALLOC)(void *ptr, int size);
|
||||
typedef void (*AUCODE_FREE)(void *ptr);
|
||||
|
||||
typedef struct {
|
||||
void *coder;
|
||||
void *in_data;
|
||||
void *out_data;
|
||||
uint32_t nbytes;
|
||||
uint32_t nsamples;
|
||||
uint32_t coder_state;
|
||||
int32_t ret;
|
||||
AUCODE_FRAME_INFO *frame_info;
|
||||
audio_encode_func encode_func;
|
||||
audio_decode_func decode_func;
|
||||
decode_plc_func plc_func;
|
||||
aucoder_close_func close_func;
|
||||
} RPC_AUCODE_STRUCT;
|
||||
|
||||
typedef struct {
|
||||
void *task_hdl;
|
||||
int8_t *stack_priv;
|
||||
uint32_t used_size;
|
||||
uint32_t total_size;
|
||||
uint32_t state;
|
||||
uint32_t coder_num;
|
||||
uint32_t rpc_coder_num;
|
||||
uint32_t stack_used_num;
|
||||
RPC_AUCODE_STRUCT *rpc_aucode_s[MAX_AUCODER_NUM];
|
||||
} AUCODE_MANAGE;
|
||||
|
||||
extern AUCODE_MANAGE *g_aucode_manage;
|
||||
|
||||
extern AUCODE_MALLOC aucode_malloc;
|
||||
extern AUCODE_ZALLOC aucode_zalloc;
|
||||
extern AUCODE_CALLOC aucode_calloc;
|
||||
extern AUCODE_REALLOC aucode_realloc;
|
||||
extern AUCODE_FREE aucode_free;
|
||||
|
||||
extern void reg_aucoder_alloc(AUCODE_MALLOC m, AUCODE_ZALLOC z, AUCODE_CALLOC c, AUCODE_REALLOC r, AUCODE_FREE f);
|
||||
extern void aucode_mutex_init(void);
|
||||
extern void *aucode_stack_alloc(uint32_t size);
|
||||
extern void aucode_stack_free(void *ptr);
|
||||
extern AUCODE_HDL *audio_coder_open(uint32_t coder, uint32_t samplerate, uint32_t channel);
|
||||
extern int32_t audio_encoder_set_bitrate(AUCODE_HDL *aucode_hdl, uint32_t bitrate);
|
||||
extern int32_t audio_encode_data(AUCODE_HDL *aucode_hdl, int16_t *in_data, uint32_t samples, uint8_t *out_data);
|
||||
extern int32_t audio_decode_fade_in(AUCODE_HDL *aucode_hdl);
|
||||
extern int32_t audio_decode_fade_out(AUCODE_HDL *aucode_hdl);
|
||||
extern int32_t audio_decode_data(AUCODE_HDL *aucode_hdl, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info);
|
||||
extern int32_t audio_decode_output_mute(AUCODE_HDL *aucode_hdl, int16_t *out_data);
|
||||
extern int32_t audio_decode_do_plc(AUCODE_HDL *aucode_hdl, int16_t *out_data);
|
||||
extern void audio_coder_close(AUCODE_HDL *aucode_hdl);
|
||||
|
||||
extern void *aac_encoder_open(uint32_t samplerate, uint32_t channel);
|
||||
extern void *aac_decoder_open(void);
|
||||
extern void *amrnb_decoder_open(void);
|
||||
extern void *amrnb_decoder_open(void);
|
||||
extern void *mp3_decoder_open(void);
|
||||
extern void *alaw_encoder_open(void);
|
||||
extern void *alaw_decoder_open(void);
|
||||
extern void *ulaw_encoder_open(void);
|
||||
extern void *ulaw_decoder_open(void);
|
||||
extern void *opus_encoder_open(uint32_t samplerate, uint32_t channel);
|
||||
extern void *opus_decoder_open(uint32_t samplerate, uint32_t channel);
|
||||
extern int32_t opus_encoder_set_bitrate(void *coder, uint32_t bitrate);
|
||||
extern int32_t aac_encode_data(void *coder, int16_t *in_data, uint32_t samples, uint8_t *out_data);
|
||||
extern int32_t alaw_encode_data(void *coder, int16_t *in_data, uint32_t samples, uint8_t *out_data);
|
||||
extern int32_t ulaw_encode_data(void *coder, int16_t *in_data, uint32_t samples, uint8_t *out_data);
|
||||
extern int32_t opus_encode_data(void *coder, int16_t *in_data, uint32_t samples, uint8_t *out_data);
|
||||
extern int32_t aac_decode_data(void *coder, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info);
|
||||
extern int32_t amrnb_decode_data(void *coder, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info);
|
||||
extern int32_t amrwb_decode_data(void *coder, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info);
|
||||
extern int32_t mp3_decode_data(void *coder, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info);
|
||||
extern int32_t alaw_decode_data(void *coder, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info);
|
||||
extern int32_t ulaw_decode_data(void *coder, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info);
|
||||
extern int32_t opus_decode_data(void *coder, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info);
|
||||
extern int32_t opus_decode_plc(void *coder, int16_t *out_data, uint32_t samples);
|
||||
extern int32_t aac_encoder_close(void *coder);
|
||||
extern int32_t aac_decoder_close(void *coder);
|
||||
extern int32_t amrnb_decoder_close(void *coder);
|
||||
extern int32_t amrwb_decoder_close(void *coder);
|
||||
extern int32_t mp3_decoder_close(void *coder);
|
||||
extern int32_t opus_encoder_close(void *coder);
|
||||
extern int32_t opus_decoder_close(void *coder);
|
||||
|
||||
extern void *aac_encoder_open_rpc(uint32_t samplerate, uint32_t channel);
|
||||
extern void *aac_decoder_open_rpc(void);
|
||||
extern void *amrnb_decoder_open_rpc(void);
|
||||
extern void *amrwb_decoder_open_rpc(void);
|
||||
extern void *mp3_decoder_open_rpc(void);
|
||||
extern void *alaw_encoder_open_rpc(void);
|
||||
extern void *alaw_decoder_open_rpc(void);
|
||||
extern void *ulaw_encoder_open_rpc(void);
|
||||
extern void *ulaw_decoder_open_rpc(void);
|
||||
extern void *opus_encoder_open_rpc(uint32_t samplerate, uint32_t channel);
|
||||
extern void *opus_decoder_open_rpc(uint32_t samplerate, uint32_t channel);
|
||||
extern int32_t opus_encoder_set_bitrate_rpc(void *coder, uint32_t bitrate);
|
||||
extern int32_t audio_encode_data_rpc(void *coder, int16_t *in_data, uint32_t samples, uint8_t *out_data, int32_t *enc_bytes);
|
||||
extern int32_t audio_decode_data_rpc(void *coder, uint8_t *in_data, uint32_t bytes, int16_t *out_data, AUCODE_FRAME_INFO *frame_info, int32_t *dec_samples);
|
||||
extern int32_t audio_decode_plc_rpc(void *coder, int16_t *out_data, uint32_t samples, int32_t *dec_samples);
|
||||
extern int32_t audio_coder_close_rpc(void *coder);
|
||||
|
||||
extern int32_t audio_coder_run(AUCODE_MANAGE *aucode_manage);
|
||||
extern int32_t audio_coder_run_rpc(AUCODE_MANAGE *aucode_manage);
|
||||
|
||||
#endif
|
||||
92
sdk/include/lib/audio/audio_proc/audio_proc.h
Normal file
92
sdk/include/lib/audio/audio_proc/audio_proc.h
Normal file
@@ -0,0 +1,92 @@
|
||||
#ifndef _AUDIO_PROCESS_CTRL_H_
|
||||
#define _AUDIO_PROCESS_CTRL_H_
|
||||
|
||||
#include "typesdef.h"
|
||||
#include "osal/string.h"
|
||||
|
||||
#define AUPROC_STACK_SIZE 5120
|
||||
|
||||
#define ANF_PROCESSING 0
|
||||
#define AEC_PROCESSING 1
|
||||
#define AHS_PROCESSING 1
|
||||
#define ANS_PROCESSING 1
|
||||
#define RES_PROCESSING 1
|
||||
|
||||
typedef void *(*AUPROC_MALLOC)(int size);
|
||||
typedef void *(*AUPROC_ZALLOC)(int size);
|
||||
typedef void *(*AUPROC_CALLOC)(int nmemb, int size);
|
||||
typedef void *(*AUPROC_REALLOC)(void *ptr, int size);
|
||||
typedef void (*AUPROC_FREE)(void *ptr);
|
||||
|
||||
extern volatile AUPROC_MALLOC auproc_malloc;
|
||||
extern volatile AUPROC_ZALLOC auproc_zalloc;
|
||||
extern volatile AUPROC_CALLOC auproc_calloc;
|
||||
extern volatile AUPROC_REALLOC auproc_realloc;
|
||||
extern volatile AUPROC_FREE auproc_free;
|
||||
|
||||
enum {
|
||||
TYPE_VOICE_ONLY,
|
||||
TYPE_MUSIC_ONLY,
|
||||
TYPE_HYBRID,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int8_t *stack_priv;
|
||||
uint32_t used_size;
|
||||
uint32_t total_size;
|
||||
} AUPROC_STACK;
|
||||
|
||||
typedef struct {
|
||||
uint32_t samplerate;
|
||||
uint32_t channels;
|
||||
|
||||
uint32_t near_discard_ms;
|
||||
uint32_t far_discard_ms;
|
||||
|
||||
uint32_t rand_seed;
|
||||
|
||||
float cosTable[256];
|
||||
float sinTable[256];
|
||||
|
||||
float *time_inputbuf;
|
||||
float *last_freq_buf;
|
||||
int16_t *overlap_buf;
|
||||
float *last_magn;
|
||||
float *filter_w;
|
||||
struct domainTrans_struct *domainTrans_s;
|
||||
|
||||
void *anf;
|
||||
void *aec;
|
||||
void *ahs;
|
||||
void *ans;
|
||||
void *vad;
|
||||
void *agc;
|
||||
void *res;
|
||||
|
||||
float *noiseEsit;
|
||||
} AUPROC_HDL;
|
||||
|
||||
AUPROC_HDL *audio_process_init(uint32_t samplerate, uint32_t channels, uint32_t frame_size);
|
||||
int32_t audio_process_data(AUPROC_HDL *auproc_hdl, int16_t *data, uint32_t nsamples);
|
||||
int32_t audio_process_fardata(AUPROC_HDL *auproc_hdl, int16_t *data, uint32_t nsamples);
|
||||
int32_t audio_resample_config(AUPROC_HDL *auproc_hdl, uint32_t src_samplerate, uint32_t dest_samplerate);
|
||||
int32_t audio_resample_data(AUPROC_HDL *auproc_hdl, int16_t *in_data, uint32_t in_size, int16_t *out_data, uint32_t *out_size);
|
||||
int32_t audio_process_deinit(AUPROC_HDL *auproc_hdl);
|
||||
|
||||
void reg_auproc_alloc(AUPROC_MALLOC m, AUPROC_ZALLOC z, AUPROC_CALLOC c, AUPROC_REALLOC r, AUPROC_FREE f);
|
||||
void *auproc_stack_alloc(uint32_t size);
|
||||
void auproc_stack_free(void *ptr);
|
||||
AUPROC_HDL *audio_process_open(uint32_t samplerate, uint32_t channels, uint32_t frame_size);
|
||||
int32_t audio_process_prepare(AUPROC_HDL *auproc_hdl);
|
||||
int32_t audio_process(AUPROC_HDL *auproc_hdl, int16_t *data, uint32_t size);
|
||||
int32_t audio_process_put_fardata(AUPROC_HDL *auproc_hdl, int16_t *data, uint32_t size);
|
||||
int32_t audio_resample_reconfig(AUPROC_HDL *auproc_hdl, uint32_t src_samplerate, uint32_t dest_samplerate);
|
||||
int32_t audio_resample(AUPROC_HDL *auproc_hdl, int16_t *in_data, uint32_t in_size, int16_t *out_data, uint32_t *out_size);
|
||||
int32_t audio_process_close(AUPROC_HDL *auproc_hdl);
|
||||
|
||||
int32_t auproc_attach_anf(AUPROC_HDL * auproc_hdl);
|
||||
int32_t auproc_attach_aec(AUPROC_HDL * auproc_hdl);
|
||||
int32_t auproc_attach_ahs(AUPROC_HDL * auproc_hdl, uint8_t mode);
|
||||
int32_t auproc_attach_ans(AUPROC_HDL * auproc_hdl, uint8_t mode);
|
||||
int32_t auproc_attach_res(AUPROC_HDL * auproc_hdl);
|
||||
#endif
|
||||
22
sdk/include/lib/audio/ring_buffer/ring_buffer.h
Normal file
22
sdk/include/lib/audio/ring_buffer/ring_buffer.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef _RING_BUFFER_H_
|
||||
#define _RING_BUFFER_H_
|
||||
|
||||
typedef struct RINGBUF {
|
||||
uint8_t *data;
|
||||
uint32_t front;
|
||||
uint32_t rear;
|
||||
uint32_t elementsize;
|
||||
uint32_t elementcount;
|
||||
} RINGBUF;
|
||||
|
||||
RINGBUF *ringbuf_Init(uint8_t elementsize, uint32_t elementcount);
|
||||
int32_t ringbuf_read_available(RINGBUF *ringbuf);
|
||||
int32_t ringbuf_write_available(RINGBUF *ringbuf);
|
||||
int32_t ringbuf_read(RINGBUF *ringbuf, void *data, uint32_t elementcount);
|
||||
int32_t ringbuf_write(RINGBUF *ringbuf, void *data, uint32_t elementcount);
|
||||
int32_t ringbuf_move_readptr(RINGBUF *ringbuf, int32_t elementcount);
|
||||
int32_t ringbuf_read_nomove(RINGBUF *ringbuf, void *data, uint32_t elementcount);
|
||||
void ringbuf_clean(RINGBUF *ringbuf);
|
||||
void ringbuf_del(RINGBUF *ringbuf);
|
||||
|
||||
#endif
|
||||
36
sdk/include/lib/audio/uac/uac_host.h
Normal file
36
sdk/include/lib/audio/uac/uac_host.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef _UAC_HOST_H_
|
||||
#define _UAC_HOST_H_
|
||||
#include "basic_include.h"
|
||||
#include "hal/usb_device.h"
|
||||
|
||||
typedef struct{
|
||||
struct list_head list;
|
||||
uint8 *data_addr; //当前写入数据的地址
|
||||
uint32 data_len;
|
||||
uint32 respace_len;
|
||||
uint32 offset;
|
||||
uint8 sta;
|
||||
}UAC_MANAGE;
|
||||
|
||||
typedef void (*usbh_audio_spk_tx)(void * p_dev, uint8_t ep, uint8_t *data, uint32_t len);
|
||||
|
||||
void del_usbmic_frame(UAC_MANAGE *uac_manage);
|
||||
void del_usbspk_frame(UAC_MANAGE *uac_manage);
|
||||
UAC_MANAGE *get_usbmic_frame(void);
|
||||
UAC_MANAGE *get_usbspk_new_frame(uint8 grab);
|
||||
uint32 get_uac_frame_datalen(UAC_MANAGE *uac_manage);
|
||||
uint8 *get_uac_frame_data(UAC_MANAGE *uac_manage);
|
||||
void set_uac_frame_datalen(UAC_MANAGE *uac_manage, uint32 len);
|
||||
void put_usbspk_frame_to_use(UAC_MANAGE *uac_manage);
|
||||
void set_uac_frame_sta(UAC_MANAGE *uac_manage, uint8 sta);
|
||||
void usbspk_room_init(uint32_t empty_buf_len);
|
||||
void usbmic_room_init(void);
|
||||
void usbmic_room_del(void);
|
||||
void usbspk_room_del(void);
|
||||
void uac_stop(void);
|
||||
void force_reset_usbmic_frame();
|
||||
void force_reset_usbspk_frame();
|
||||
int usbmic_deal(struct usb_device *p_dev, uint8_t* rx_buff);
|
||||
void usbspk_tx(struct usb_device *p_dev, uint8_t ep, uint32_t len, usbh_audio_spk_tx func);
|
||||
|
||||
#endif
|
||||
89
sdk/include/lib/audio/wsola/wsola_process.h
Normal file
89
sdk/include/lib/audio/wsola/wsola_process.h
Normal file
@@ -0,0 +1,89 @@
|
||||
#ifndef _WSOLA_PROCESS_H_
|
||||
#define _WSOLA_PROCESS_H_
|
||||
|
||||
#include "typesdef.h"
|
||||
#include "osal/string.h"
|
||||
#include "lib/audio/ring_buffer/ring_buffer.h"
|
||||
|
||||
typedef void *(*WSOLA_MALLOC)(int size);
|
||||
typedef void *(*WSOLA_ZALLOC)(int size);
|
||||
typedef void *(*WSOLA_CALLOC)(int nmemb, int size);
|
||||
typedef void *(*WSOLA_REALLOC)(void *ptr, int size);
|
||||
typedef void (*WSOLA_FREE)(void *ptr);
|
||||
|
||||
extern WSOLA_MALLOC wsola_malloc;
|
||||
extern WSOLA_ZALLOC wsola_zalloc;
|
||||
extern WSOLA_CALLOC wsola_calloc;
|
||||
extern WSOLA_REALLOC wsola_realloc;
|
||||
extern WSOLA_FREE wsola_free;
|
||||
|
||||
typedef struct {
|
||||
RINGBUF *input_ringbuf;
|
||||
RINGBUF *output_ringbuf;
|
||||
int16_t *input_buf;
|
||||
int16_t *output_buf;
|
||||
int16_t *downsample_buf;
|
||||
int16_t *pitch_buf;
|
||||
|
||||
int32_t max_required;
|
||||
int32_t max_period_nsamples;
|
||||
int32_t min_period_nsamples;
|
||||
int32_t prev_period_nsamples;
|
||||
int32_t prev_min_diff;
|
||||
|
||||
float pitch;
|
||||
float speed;
|
||||
|
||||
float persample_time;
|
||||
float input_playtime;
|
||||
float time_err;
|
||||
|
||||
int32_t input_nsamples;
|
||||
int32_t output_nsamples;
|
||||
int32_t pitch_nsamples;
|
||||
int32_t reserve_nsamples;
|
||||
|
||||
int32_t old_rate_position;
|
||||
int32_t new_rate_position;
|
||||
|
||||
uint32_t input_buf_size;
|
||||
uint32_t output_buf_size;
|
||||
uint32_t downsample_buf_size;
|
||||
uint32_t pitch_buf_size;
|
||||
|
||||
uint32_t samplerate;
|
||||
uint32_t channels;
|
||||
}WsolaStream;
|
||||
|
||||
void reg_wsola_alloc(WSOLA_MALLOC m, WSOLA_ZALLOC z, WSOLA_CALLOC c, WSOLA_REALLOC r, WSOLA_FREE f);
|
||||
WsolaStream *wsolaStream_init(uint32_t samplerate, uint32_t channels, float speed, float pitch,
|
||||
uint32_t max_input_nsamples, uint32_t max_output_nsamples);
|
||||
int32_t wsolaStream_input_data(WsolaStream* stream, int16_t *data, uint32_t nsamples);
|
||||
int32_t wsolaStream_output_data(WsolaStream* stream, int16_t *data, uint32_t max_nsamples);
|
||||
int32_t wsolaStream_input_available(WsolaStream* stream);
|
||||
int32_t wsolaStream_output_available(WsolaStream* stream);
|
||||
void wsolaStream_set_pitch(WsolaStream* stream, float pitch);
|
||||
void wsolaStream_set_speed(WsolaStream* stream, float speed);
|
||||
float wsolaStream_get_pitch(WsolaStream* stream);
|
||||
float wsolaStream_get_speed(WsolaStream* stream);
|
||||
uint32_t wsolaStream_get_sampleRate(WsolaStream *stream);
|
||||
void wsolaStream_clean(WsolaStream* stream);
|
||||
int32_t wsolaStream_flush(WsolaStream* stream);
|
||||
void wsolaStream_deinit(WsolaStream *stream);
|
||||
|
||||
WsolaStream *wsola_stream_init(uint32_t samplerate, uint32_t channels,
|
||||
uint32_t max_input_nsamples, uint32_t max_output_nsamples);
|
||||
int32_t wsola_stream_write_data(WsolaStream* stream, int16_t *data, uint32_t nsamples);
|
||||
int32_t wsola_stream_read_data(WsolaStream* stream, int16_t *data, uint32_t max_nsamples);
|
||||
int32_t wsola_stream_write_available(WsolaStream* stream);
|
||||
int32_t wsola_stream_read_available(WsolaStream* stream);
|
||||
void wsola_stream_set_pitch(WsolaStream* stream, float pitch);
|
||||
void wsola_stream_set_speed(WsolaStream* stream, float speed);
|
||||
float wsola_stream_get_pitch(WsolaStream* stream);
|
||||
float wsola_stream_get_speed(WsolaStream* stream);
|
||||
uint32_t wsola_stream_get_samplerate(WsolaStream *stream);
|
||||
void wsola_stream_clean(WsolaStream* stream);
|
||||
int32_t wsola_stream_flush(WsolaStream *stream);
|
||||
void wsola_stream_deinit(WsolaStream *stream);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user