• Home
  • Raw
  • Download

Lines Matching refs:bat

89 static int reorder(struct bat *bat, float *val, int frames)  in reorder()  argument
94 bytes = frames * bat->channels * sizeof(float); in reorder()
98 fprintf(bat->err, _("Not enough memory.\n")); in reorder()
104 for (c = 0; c < bat->channels; c++) in reorder()
105 val[i * bat->channels + c] = in reorder()
112 static int adjust_waveform(struct bat *bat, float *val, int frames, in adjust_waveform() argument
118 switch (bat->format) { in adjust_waveform()
133 fprintf(bat->err, _("Invalid PCM format: %d\n"), bat->format); in adjust_waveform()
146 int generate_sine_wave(struct bat *bat, int frames, void *buf) in generate_sine_wave() argument
153 nsamples = bat->channels * frames; in generate_sine_wave()
156 fprintf(bat->err, _("Not enough memory.\n")); in generate_sine_wave()
160 for (c = 0; c < bat->channels; c++) { in generate_sine_wave()
162 if (sg[c].frequency != bat->target_freq[c]) in generate_sine_wave()
163 sin_generator_init(&sg[c], 1.0, bat->target_freq[c], in generate_sine_wave()
164 bat->rate); in generate_sine_wave()
170 err = reorder(bat, sinus_f, frames); in generate_sine_wave()
175 err = adjust_waveform(bat, sinus_f, frames, bat->channels); in generate_sine_wave()
179 bat->convert_float_to_sample(sinus_f, buf, frames, bat->channels); in generate_sine_wave()
188 int generate_sine_wave_raw_mono(struct bat *bat, float *buf, in generate_sine_wave_raw_mono() argument
194 err = sin_generator_init(&sg, 1.0, freq, bat->rate); in generate_sine_wave_raw_mono()
200 err = adjust_waveform(bat, buf, nsamples, 1); in generate_sine_wave_raw_mono()