audioutils/fmsynth: Add create instance for static

To use this with static instance, add create function with
arguments.
This commit is contained in:
SPRESENSE 2023-07-12 00:26:05 +09:00 • committed by Xiang Xiao
parent 5365fc9ffd
commit 4a4c550ced
6 changed files with 107 additions and 34 deletions

View file

@ -43,6 +43,7 @@
typedef struct fmsynth_sound_s
{
int own_allocate;
int phase_time;
int max_phase_time;
int volume;
@ -64,6 +65,8 @@ extern "C"
int fmsynth_initialize(int fs);
FAR fmsynth_sound_t *fmsynthsnd_create(void);
FAR fmsynth_sound_t *create_fmsynthsnd(FAR fmsynth_sound_t *);
void fmsynthsnd_stop(FAR fmsynth_sound_t *snd);
void fmsynthsnd_delete(FAR fmsynth_sound_t *snd);
int fmsynthsnd_set_operator(FAR fmsynth_sound_t *snd, FAR fmsynth_op_t *op);
void fmsynthsnd_set_soundfreq(FAR fmsynth_sound_t *snd, float freq);

View file

@ -85,6 +85,7 @@ extern "C"
{
#endif
FAR fmsynth_eg_t *create_fmsyntheg(fmsynth_eg_t *eg);
FAR fmsynth_eg_t *fmsyntheg_create(void);
void fmsyntheg_delete(FAR fmsynth_eg_t *eg);
int fmsyntheg_set_param(FAR fmsynth_eg_t *eg,

View file

@ -52,6 +52,7 @@ typedef struct fmsynth_op_s
struct fmsynth_op_s *cascadeop;
struct fmsynth_op_s *parallelop;
int own_allocate;
FAR int *feedback_ref;
int feedback_val;
int feedbackrate;
@ -75,6 +76,8 @@ extern "C"
int fmsynthop_set_samplerate(int fs);
FAR fmsynth_op_t *fmsynthop_create(void);
FAR fmsynth_op_t *create_fmsynthop(FAR fmsynth_op_t *op,
FAR fmsynth_eg_t *eg);
void fmsynthop_delete(FAR fmsynth_op_t *op);
int fmsynthop_select_opfunc(FAR fmsynth_op_t *op, int type);
int fmsynthop_set_envelope(FAR fmsynth_op_t *op,