<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Playing sound files</title>
<description> Can anyone please tell me if there is any way I could play sound files other than MOD in my Wii Homebrew application? I have some MP3 files that I want to put in my application. 

Below I have included the code that allows me to play MOD files, but is there any way to play any other kind of files (especially MP3)? (Code snipped from CodeMii.)

FILE *f = fopen(&quot;/loop.mod&quot;, &quot;rb&quot;);

if (f == NULL) {
fclose(f);
} else {
fseek (f , 0, SEEK_END);
mod_size = ftell (f);
rewind(f);

// allocate memory to contain the whole file:
buffer = (char*) malloc (sizeof(char)*mod_size);
if (buffer == NULL) { perror (&quot;Memory error\n&quot;); }

// copy the file into the buffer:
result = fread (buffer,1,mod_size,f);
if (result != mod_size) { perror (&quot;Reading error\n&quot;); }

fclose(f);

MODPlay_SetMOD(&amp;play, buffer);
MODPlay_Start(&amp;play);
}</description><link>http://forum.wiibrew.org/read.php?11,35472,35472#msg-35472</link><lastBuildDate>Thu, 16 Apr 2026 17:16:38 +0200</lastBuildDate>
<generator>Phorum 5.2.23</generator>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,42920#msg-42920</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,42920#msg-42920</link><description><![CDATA[ Arikado,<br /><br />[<a href="http://sourceforge.net/projects/devkitpro/files/examples/wii/wii-examples-20091124.tar.bz2/download" rel="nofollow">sourceforge.net</a>]<br /><br />But It&#039;s using MP3Player_PlayBuffer.]]></description>
<dc:creator>scanff</dc:creator>
<category>Coding</category><pubDate>Sun, 29 Nov 2009 04:29:59 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,42919#msg-42919</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,42919#msg-42919</link><description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>Tantric</strong><br />I&#039;ve added ogg and mp3 playback examples to the devkitpro examples.</div></blockquote>
Is it in the new libogc release?]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Sun, 29 Nov 2009 04:20:54 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,42873#msg-42873</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,42873#msg-42873</link><description><![CDATA[ I&#039;ve added ogg and mp3 playback examples to the devkitpro examples.]]></description>
<dc:creator>Tantric</dc:creator>
<category>Coding</category><pubDate>Sun, 29 Nov 2009 00:30:48 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,41819#msg-41819</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,41819#msg-41819</link><description><![CDATA[ I remember messing around with .mp3 playback. I got it to work, but I could not do any operations like seeking. Then I came upon libtremor. It plays oggs, but its very easy to use and allows for seeking, if you want to make your music loop in some way. If anyone&#039;s interested, I can post the code I used for ogg playback.]]></description>
<dc:creator>kms2061</dc:creator>
<category>Coding</category><pubDate>Fri, 20 Nov 2009 17:12:12 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,41148#msg-41148</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,41148#msg-41148</link><description><![CDATA[ can you get on irc... probably easier to help you realtime then posting time!]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Sat, 14 Nov 2009 03:32:21 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,41063#msg-41063</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,41063#msg-41063</link><description><![CDATA[ my &#039;makefile&#039; skills are non existent, and having bashed my head for an hour or two, I wondered if anyone can please explain how to get bin2o to run against a .raw file in a directory called &#039;sounds&#039; and what I need to do to get it to build/include it?<br /><br />Thanks]]></description>
<dc:creator>pembo</dc:creator>
<category>Coding</category><pubDate>Fri, 13 Nov 2009 01:29:41 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,39847#msg-39847</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,39847#msg-39847</link><description><![CDATA[ I solved it. In case anyone needs help with this, try reading this post of mine over at GBATemp:<br />? [<a href="http://gbatemp.net/index.php?s=&showtopic=186306&view=findpost&p=2350253" rel="nofollow">gbatemp.net</a>]]]></description>
<dc:creator>diego_pmc</dc:creator>
<category>Coding</category><pubDate>Sun, 01 Nov 2009 16:25:59 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,38174#msg-38174</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,38174#msg-38174</link><description><![CDATA[ bump]]></description>
<dc:creator>diego_pmc</dc:creator>
<category>Coding</category><pubDate>Fri, 16 Oct 2009 17:29:51 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,37400#msg-37400</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,37400#msg-37400</link><description><![CDATA[ Thanks for the help, and sorry I didn&#039;t reply sooner. I partly got the game to play an MP3 music file when it opens, but there is a problem. When I start the game, the music plays okay for a little while, and then it starts making one of those weird sounds when the game is blocked on a single note and keeps repeating it over and over. This happens seemingly at random points in game; it could start 2 seconds after I open the game, or it could start after 20 or so seconds.<br /><br />I posted the code below; also, <a href="http://upload.worldofplayers.de/files4/RisenTBG.rar" rel="nofollow">here&#039;s the Homebrew directory for my application</a>, if you want to check the error yourself. (When the error occurs, take the SD card out of the console, and press a button on the Wii Remote so that the Error() function would be called and the application would exit safely, so you don&#039;t have to unplug your Wii.)<br /><br /><br /><pre class="bbcode">
#include mp3player.h // lmad in MakeFile
#include asndlib.h // lasnd in MakeFile

int main()
{
    PlayMP3("data/music/RPB-WoPiMedley.mp3");
}

void PlayMP3(const std::string filename) {
    /* Sources:
      1. [<a href="http://arikadosblog.blogspot.com/2009/07/how-to-play-external-mp3-files-with.html"  rel="nofollow">arikadosblog.blogspot.com</a>]
      2. [<a href="http://www.pastie.org/541699"  rel="nofollow">www.pastie.org</a>]
     */
    ASND_Init();
    MP3Player_Init();
    FILE* f = OpenFile(filename, "rb");
    long size = FileSize(f);
	
    // allocate memory to contain the whole file:
    char* buffer;
    buffer = (char*) malloc (sizeof(char)*size);
    if (buffer == NULL) Error("cannot allocate memory for file &#039;" + filename + "&#039;");
	
    // copy the file into the buffer:
    long result = fread (buffer, 1, size, f);
    if (result != size) Error ("cannot store file &#039;" + filename + "&#039; in memory");
    fclose(f); // file is stored so we can close it now
	
    // play the buffer
    MP3Player_PlayBuffer(buffer, size, NULL);
}

FILE* OpenFile(const std::string filename, std::string fam) 
{
    FILE* file = NULL;
    if(!fatInitDefault()) Error("cannot initialize FAT system");
    file = fopen(filename.c_str(), fam.c_str()); // fam = file access mode
    if (file == NULL) Error("cannot open file &#039;" + filename + "&#039;");
    return file;
}

long FileSize(FILE* f) {
    /* Sources:
       1. [<a href="http://arikadosblog.blogspot.com/2009/07/how-to-play-external-mp3-files-with.html"  rel="nofollow">arikadosblog.blogspot.com</a>]
       2. [<a href="http://www.pastie.org/541699"  rel="nofollow">www.pastie.org</a>]
     */
    long size;
    fseek (f, 0, SEEK_END);
    size = ftell(f);
    rewind(f);
    return size;
}

void Error(const std::string message) {
    printf("\x1b[2J"); // clear the screen
    printf("\nError: "); printf("%s", message.c_str());
    WaitWiiButton(); // wait for any button to be pressed on the wiimote
    exit(1);
}
</pre>]]></description>
<dc:creator>diego_pmc</dc:creator>
<category>Coding</category><pubDate>Sat, 10 Oct 2009 16:45:24 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36935#msg-36935</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36935#msg-36935</link><description><![CDATA[ no problem man, hope it helps... when you start trying it out, let me / us know if you have any problems.<br /><br />You can obviously create your own custom sound function (or not use one at all and just call each effect individually with separate ASND_SetVoice functions)<br /><br />I just found it easier to have one ASND_SetVoice part and send varying freqs and sound files to it.]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Wed, 07 Oct 2009 04:05:48 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36735#msg-36735</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36735#msg-36735</link><description><![CDATA[ excellent thread - just about to start some adding some audio code and this will be extremely useful for both the MP3 and the sound effects bit!<br /><br />Thanks - much appreciated!]]></description>
<dc:creator>pembo</dc:creator>
<category>Coding</category><pubDate>Mon, 05 Oct 2009 22:10:05 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36570#msg-36570</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36570#msg-36570</link><description><![CDATA[ so you don&#039;t have to wait for my source, here&#039;s what i did:<br /><br />i wanted the ability to play the same sound effect but be able to pick at which frequency it played at based on game play.<br />Example: when you lay a poker chip down it made a standard chip down sound... but when you laid a STACK of chips down, it played the same sound effect but with a deeper tone (lower frequency) so you got multiple sounds but only used one pcm file.<br /><br />So i made my own function:<br /><br /><pre class="bbcode">
void playsfx(int freq, void *pcm, s32 pcmsize) {
	ASND_SetVoice(SND_GetFirstUnusedVoice(), 3, freq, 0, pcm, pcmsize, soundvol, soundvol, NULL);
}</pre><br />The GetFirstUnusedVoice part was the key to having multiple sounds playing at once, it would just find the first open "audio slot" and assign the sound to that and play it... thus not disturbing any other sound being played.<br /><br />The 3 just corresponds to 16bit stereo:<br />a 0 = 8bit mono<br />a 1 = 16bit mono<br />a 2 = 8bit stereo<br /><br />so you&#039;ll want your pcm files to be in that format (or match up with whatever format you pick)<br /><br />the freq part is passed into the function (which freq you want)<br />the 0 is how much of a delay<br />the pcm is passed into the function (which sound to play)<br />the pcmsize is passed into the function (size of sound)<br />the soundvol is defined by the user in my settings section and is just the volume (it&#039;s done twice, first is left speaker, second is right speaker)<br />the NULL has something to do with the CALLBACK... not sure what it is for, i just left it NULL!<br /><br />so then whenever i want to play a sound effect i just do this:<br /><br /><pre class="bbcode">
playsfx(44100, (char *) click_pcm, click_pcm_size);</pre><br />that&#039;s it, it&#039;ll play my click_pcm sound effect at a freq of 44100<br /><br />the click_pcm is included at the top with the rest of my sound effects.<br /><br /><pre class="bbcode">
#include "click_pcm.h"</pre><br />you&#039;ll need the #include asndlilb.h and the -lasnd in your makefile of course.<br /><br />then all i do is put my click.pcm file that i created and let my makefile use bin2o to convert it into a .h<br /><br />the only other key is to actually put your sound effect (the click.pcm) into the right format.<br /><br />I&#039;ve been using <a href="http://www.goldwave.com/" rel="nofollow">Goldwave</a> to save them as raw file type and then "PCM signed 16 bit, big endian, stereo" (when you click save as and change the file type to raw, you&#039;ll find that big endian stuff in the attributes menu). That format lines up nicely with "3" and seems to be the popular choice based on all of my searches back when i was learning.<br /><br />Hope that helps. Let me know if you get it to work / if that&#039;s what you need. I&#039;ll be happy to fine tune, go into more detail on what i did.]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 16:45:52 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36563#msg-36563</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36563#msg-36563</link><description><![CDATA[ I will have to take a look at your source as soon as it is released then! My "audio puzzle" is missing the sound effects piece...]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 16:05:33 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36560#msg-36560</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36560#msg-36560</link><description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />Does your "playing audio puzzle" include sound effects? If so, do they work properly with the background audio?</div></blockquote><br />yes it does and yes they do!<br /><br />even have multiple sound effects playing at the same time with the looping audio... (GetFirstUnusedVoice is my friend!!)]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 15:53:45 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36559#msg-36559</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36559#msg-36559</link><description><![CDATA[ Yeah, no problem :-)<br /><br />Does your "playing audio puzzle" include sound effects? If so, do they work properly with the background audio?]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 15:51:27 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36558#msg-36558</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36558#msg-36558</link><description><![CDATA[ oops, i edited out my questions because i asked them before i tested :D<br /><br />Yeah, i think your guesstimations are pretty close. My 3MB sound file took about 3 seconds to load (based on how long my cursor was frozen). Then i removed the load portions from my press A code and like you mentioned and it does all that in the background while i&#039;m navigating to the audio menu :D<br /><br />yeah i was worried about starting it before the song finished loading all the way, but I&#039;ll just be sure to load it before it needs it type deal.<br /><br />thanks again man, external mp3 playing was the last piece of my "playing audio" puzzle!]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 15:44:27 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36551#msg-36551</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36551#msg-36551</link><description><![CDATA[ I&#039;m not sure about the mb/second rate, but if you look at that Wii Shooting Gallery Beta I posted, you can probably do a little bit of guesstimation. None of the songs cause the game to hang longer than about 5 seconds, none of them reach the 4mb mark though IIRC.<br /><br />Actually, the song being started before it is fully loaded was a weird problem I encountered (especially if you put a function that loops the music on a thread). When it occurs, everything is fine except that the sound simply doesn&#039;t play (note that I haven&#039;t had this happen since updating to devkitPROr17, so the results may be different for that build).<br /><br />I love questions :-)]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 15:34:17 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36549#msg-36549</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36549#msg-36549</link><description><![CDATA[ AWESOME!<br /><br />it was the fatinitdefault(); line.<br /><br />works like a charm now<br /><br />I also moved all the stuff except the play buffer line out of the "press A" code like you suggested... got rid of the 2 second frozen cursor i got while it was loading in the buffer...<br /><br />thanks guys!]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 15:23:25 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36542#msg-36542</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36542#msg-36542</link><description><![CDATA[ Did you link in and include libfat and call fatInitDefault()?<br /><br /><b>Edit:</b> scanff beat me to it :-P<br /><br /><b>Edit 2:</b> Also, if you only have one sound file, the only function you need to call is MP3Player_PlayBuffer() when A is pressed. All of the other work could be done outside of the A button press (your code would be much more efficient that way).<br /><br />Also, add this into your code:<br /><pre class="bbcode">
if(WPAD_ButtonsDown(WPAD_CHAN_0)&WPAD_BUTTON_B){
if(MP3Player_IsPlaying())
MP3Player_Stop();
}
</pre>]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 15:06:14 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36497#msg-36497</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36497#msg-36497</link><description><![CDATA[ You need fatInitDefault(); before you do anything with files.]]></description>
<dc:creator>scanff</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 05:45:17 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36495#msg-36495</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36495#msg-36495</link><description><![CDATA[ full source is 4308 lines long... but i can paste the related items.<br /><br /><br /><pre class="bbcode">
#include asndlib.h
#include mp3player.h

FILE *BGM = 0;
long lSize;
char * mbuffer;
size_t mresult;

int main() {

ASND_Init();
MP3Player_Init();
while(1){
    Scanpads
    WHEN A IS PRESSED {
        BGM = fopen("test.mp3", "rb");
        fseek (BGM , 0 , SEEK_END);
        lSize = ftell (BGM);
        rewind (BGM);
        mbuffer = (char*) malloc (sizeof(char)*lSize);
        mresult = fread (mbuffer,1,lSize,BGM);
        fclose(BGM);
        MP3Player_PlayBuffer(mbuffer, lSize, NULL);
    }
}
}</pre>
No compile errors, just dump when i press A<br />I&#039;m thinking i don&#039;t have the "read from sd card" commands set up correctly.]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Sun, 04 Oct 2009 04:50:00 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36374#msg-36374</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36374#msg-36374</link><description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>mdbrim</strong><br />no love huh?<br /><br />oh well.</div></blockquote>
I need to see the full source.]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Sat, 03 Oct 2009 18:36:49 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36329#msg-36329</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36329#msg-36329</link><description><![CDATA[ can you paste bin the the code and I&#039;ll take a look.]]></description>
<dc:creator>scanff</dc:creator>
<category>Coding</category><pubDate>Sat, 03 Oct 2009 07:36:44 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,36312#msg-36312</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,36312#msg-36312</link><description><![CDATA[ no love huh?<br /><br />oh well.]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Sat, 03 Oct 2009 04:47:20 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,35868#msg-35868</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,35868#msg-35868</link><description><![CDATA[ Arikado, (or anyone with the mp3 skillz!) I followed your blog to try to add mp3 from sd support in my app. did the following:<br /><br /><pre class="bbcode">
FILE *BGM = 0;
long lSize;
char * mbuffer;
size_t mresult;
bool mp3isready = false;</pre><br />up at the top.<br /><br />down in the body of my code put this in under my "when A is pressed"<br /><br /><pre class="bbcode">
					BGM = fopen("test.mp3", "rb");
					fseek (BGM , 0 , SEEK_END);
					lSize = ftell (BGM);
					rewind (BGM);
	
					mbuffer = (char*) malloc (sizeof(char)*lSize);
					mresult = fread (mbuffer,1,lSize,BGM);
	
					fclose(BGM);
					MP3Player_PlayBuffer(mbuffer, lSize, NULL);</pre><br />You&#039;ll note i had to rename to mbuffer and mresult just because I was already using buffer and result.<br /><br />IOn my sd card in the folder with boot.dol is test.mp3<br /><br />I tried the loopthemp3 function method as well but since i&#039;m just trying to get it to play once, i commented all that out so i could just test it playing once. Obviously because of that, the mp3isready part isn&#039;t needed so we&#039;ll ignore that.<br /><br />Anyway, start up app, press A and get the nice stack dump. Anything you notice off the bat that is my prob?<br /><br />This is my first attempt at loading something off of the SD card so totally new to fopen fseek fread etc.<br /><br />Compiles with no problems, just crashes when i press A<br /><br />The ASND_Init(); and MP3Player_Init(); are also in there and that all happens before the A code is run... and that part is working because all my other music and snd fx still work.]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Thu, 01 Oct 2009 05:19:54 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,35621#msg-35621</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,35621#msg-35621</link><description><![CDATA[ [<a href="http://arikadosblog.blogspot.com/2009/07/how-to-play-external-mp3-files-with.html" rel="nofollow">arikadosblog.blogspot.com</a>]<br /><br />Only method I know of that works to play MP3s smoothly and without crashing.]]></description>
<dc:creator>Arikado</dc:creator>
<category>Coding</category><pubDate>Tue, 29 Sep 2009 23:15:20 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,35475#msg-35475</guid>
<title>Re: Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,35475#msg-35475</link><description><![CDATA[ There are a lot post about this topic, here is the one that helped me: [<a href="http://forum.wiibrew.org/read.php?11,12616" rel="nofollow">forum.wiibrew.org</a>]]]></description>
<dc:creator>Crayon</dc:creator>
<category>Coding</category><pubDate>Tue, 29 Sep 2009 16:19:39 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,35472,35472#msg-35472</guid>
<title>Playing sound files</title><link>http://forum.wiibrew.org/read.php?11,35472,35472#msg-35472</link><description><![CDATA[ Can anyone please tell me if there is any way I could play sound files other than MOD in my Wii Homebrew application? I have some MP3 files that I want to put in my application.<br /><br />Below I have included the code that allows me to play MOD files, but is there any way to play any other kind of files (especially MP3)? (Code snipped from CodeMii.)<br /><pre class="bbcode">
	FILE *f = fopen("/loop.mod", "rb");
	
	if (f == NULL) {
		fclose(f);
	} else {
		fseek (f , 0, SEEK_END);
		mod_size = ftell (f);
		rewind(f);
		
		// allocate memory to contain the whole file:
		buffer = (char*) malloc (sizeof(char)*mod_size);
		if (buffer == NULL) { perror ("Memory error\n"); }
		
		// copy the file into the buffer:
		result = fread (buffer,1,mod_size,f);
		if (result != mod_size) { perror ("Reading error\n"); }
		
		fclose(f);
		
		MODPlay_SetMOD(&play, buffer);
		MODPlay_Start(&play);
	}</pre>]]></description>
<dc:creator>diego_pmc</dc:creator>
<category>Coding</category><pubDate>Tue, 29 Sep 2009 15:16:24 +0200</pubDate></item>
</channel>
</rss>