From WiiBrew
< User:Scanff
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Wiiradio img.png

Libwiiradio is a simple and easy to implement library you can add to your game or homebrew app that gives you the ability to playback internet radio.


There is an example of how to use LibWiiRadio included in the download.

Here's a list of the functions.

// play a stream
int LWR_Play(char*);

// stop playback
int LWR_Stop();

// return the current URL
char* LWR_GetUrl();

// return what's playing
char* LWR_GetCurrentTrack();

// return bitrate
int LWR_GetCurrentBitRate();

// return the volume
int LWR_GetVolume();

// set the volume
void LWR_SetVolume(int);

  Set the audio buffer size - default is 2MB which works well.
  This must be called before LWR_Play or it has no effect!
int LWR_SetBufferSize(unsigned long);

Here's a quick example.

char* tests[] = {   "",

int test_lib()
    printf("\n\n\n\nTest libWiiRadio, will test three streams!\n");

    for(int i = 0; i < 3;i++)
        printf("Connecting to %s\n", tests[i]);

        printf("setting volume %d\n", 40*(i+1));

        if(LWR_Play(tests[i]) < 0)

        usleep(2000000); // wait till the info is grabbed

        char *title = LWR_GetCurrentTrack();
        if (title) printf("current track = %s\n", title);

        int br = LWR_GetCurrentBitRate();
        if (br != -1) printf("current bitrate = %d\n", br);
	char* url = LWR_GetUrl();
	if (url) printf("current url = %s\n", url);
	int vol = LWR_GetVolume();
        if (vol != -1) printf("current volume = %d\n", vol);
	usleep(30000000); // play for a while

	printf("Stop Playback!\n");


    printf("Test Done!\n");

    return 0;


An example of linking Libwiiradio in your make file.

LIBS := -lwiiradio -lmad -lasnd -lbte -logc -lm

Bugs & Suggestions

I'm unsure how this lib would work with other sound libraries being used on Wii. If you are interested in testing and giving feedback I'd really appreciate it.

Please report to the main WiiRadio repository -

Update History

1.00 - Coming very soon

  • Initial release