Rockbox audio format

Tags: rockbox audio c
By : num1
Source: Stackoverflow.com
Question!

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

By : num1


Answers

The prototype for the callback function is as follows:

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);


On windows, curses works out of the box, ncurses doesn't, and for a progress bar curses should be sufficient. So, use curses instead of ncurses.

Also, both curses and ncurses are wafer-thin wrappers around the c library - that means you don't really need Ruby-specific tutorials.

However, on the site for the PickAxe you can download all the code examples for the book. The file "ex1423.rb" contains a curses demo which plays Pong - that should give you plenty of material to get you going.



Very late answer and sorry for self promotion, but I created library to show progress in terminal.

By : tig


This video can help you solving your question :)
By: admin