रॉकबॉक्स ऑडियो प्रारूप

How do you specify a callback for rb->pcm_play_data()?


1 उत्तर

कॉलबैक फ़ंक्शन के लिए प्रोटोटाइप निम्नानुसार है:

static void my_audio_callback(const void **start, size_t *size);

*start should be set to point to the region of memory where your PCM data is stored (16-bit signed integers), and *size should be the size of this region.

Once you've written your callback, call rb->pcm_play_data(), and enjoy the music!

rb->pcm_play_data(my_audio_callback, NULL, NULL, 0);