#include #include #include #include #include #include "channel.h" struct mossrose_global_t { PaStream *stream; struct channel_t *channels; int n_channels; } mossrose_global; static int callback( const void *input, void *output, unsigned long frame_count, const PaStreamCallbackTimeInfo* time_info, PaStreamCallbackFlags status_flags, void *user_data) { printf("frame count: %d\n", frame_count); float *out = output; float *left, *right; float l, r; for (int i=0; i= 0) { /* play on specified channel */ if (channel_sound_load(mossrose_global.channels + channel, sound, true) == 0) return channel; else return -1; } else { /* play on first available channel */ for (int i=0; i