/* * Start the audio loop (for testing) */ static int auloop_start(struct re_printf *pf, void *arg) { struct cmd_arg *carg = arg; struct pl pl_srate, pl_ch; uint32_t srate, ch; int err; if (gal) return re_hprintf(pf, "audio-loop already running.\n"); err = re_regex(carg->prm, str_len(carg->prm), "[0-9]+ [0-9]+", &pl_srate, &pl_ch); if (err) { return re_hprintf(pf, "Usage:" " /auloop <samplerate> <channels>\n"); } srate = pl_u32(&pl_srate); ch = pl_u32(&pl_ch); if (!srate || !ch) return re_hprintf(pf, "invalid samplerate or channels\n"); err = audio_loop_alloc(&gal, srate, ch); if (err) { warning("auloop: alloc failed %m\n", err); } return err; }
/** * Start the audio loop (for testing) */ static int auloop_start(struct re_printf *pf, void *arg) { int err; (void)pf; (void)arg; if (gal) { err = audio_loop_cycle(gal); if (err) { warning("auloop: loop cycle: %m\n", err); } } else { err = audio_loop_alloc(&gal); if (err) { warning("auloop: alloc failed %m\n", err); } } return err; }
/** * Start the audio loop (for testing) */ static int auloop_start(struct re_printf *pf, void *arg) { int err; (void)pf; (void)arg; if (gal) { err = audio_loop_cycle(gal); if (err) { DEBUG_WARNING("cycle: %m\n", err); } } else { err = audio_loop_alloc(&gal); if (err) { DEBUG_WARNING("auloop: %m\n", err); } } return err; }