<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Playing Sounds</title>
<description>What way to play sounds do you recommend?</description><link>http://forum.wiibrew.org/read.php?11,19812,19812#msg-19812</link><lastBuildDate>Tue, 08 Sep 2026 14:27:57 +0200</lastBuildDate>
<generator>Phorum 5.2.23</generator>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,22732#msg-22732</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,22732#msg-22732</link><description><![CDATA[ GoldWave works like a champ...<br /><br />Open any music file type.<br />Do whatever you want to it...<br />Save as raw from the pull down box...<br />Pick 16 bit signed big endian stereo from another pull down box...<br />works like a charm with ASND]]></description>
<dc:creator>mdbrim</dc:creator>
<category>Coding</category><pubDate>Mon, 29 Jun 2009 14:31:49 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,22731#msg-22731</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,22731#msg-22731</link><description><![CDATA[ I agree. I have tried thet signed format and it works :)]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Mon, 29 Jun 2009 13:56:31 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,22725#msg-22725</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,22725#msg-22725</link><description><![CDATA[ sample data need to be signed off course (short int buffer format)<br /><br />0x7FFF = 32767<br />0x8000 = -32768<br />0xFFFF = -1]]></description>
<dc:creator>ekeeke</dc:creator>
<category>Coding</category><pubDate>Mon, 29 Jun 2009 12:47:25 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,22722#msg-22722</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,22722#msg-22722</link><description><![CDATA[ But is it signed or not? I think that it&#039;s not.]]></description>
<dc:creator>henke37</dc:creator>
<category>Coding</category><pubDate>Mon, 29 Jun 2009 12:31:02 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,22718#msg-22718</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,22718#msg-22718</link><description><![CDATA[ as Tantric said, the sample format supported by the Wii is litterally "16 bit <b>big endian</b> stereo". Raw could mean anything and do not give an idea about the used endiannes but since the default format on PC platform is little endian, you probably end up with "inverted samples", meaning that something that sould be output at +2 (0x0002) is output at +512 (0x0200)]]></description>
<dc:creator>ekeeke</dc:creator>
<category>Coding</category><pubDate>Mon, 29 Jun 2009 10:58:40 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,22712#msg-22712</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,22712#msg-22712</link><description><![CDATA[ I&#039;m at the exact same stage as profetylen right now; I just set up the ogg player successfully (Ran into the same linking errors too, but found the fix after a bit of googling. Wish I had stumbled upon this thread sooner.) Anyway, I&#039;m also working on sound effects now, and I was just wondering if anyone has had any luck in using Audacity to convert sound effects. I&#039;m pretty sure I&#039;m saving using the right parameters (Raw PCM, 16-bit, 48khz), but it always comes out all distorted and staticy. I could always try GoldWave, but I&#039;d rather not install anything I don&#039;t have to.]]></description>
<dc:creator>Couchy</dc:creator>
<category>Coding</category><pubDate>Mon, 29 Jun 2009 09:02:17 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,22470#msg-22470</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,22470#msg-22470</link><description><![CDATA[ Okay! Thanks for all the help!]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Sat, 27 Jun 2009 18:50:36 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,22331#msg-22331</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,22331#msg-22331</link><description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>profetylen</strong><br />Ok!<br /><br />Do you know of any app, that I can look at, that uses the wiimote speakers?</div></blockquote><br />There are absolutely no apps usig the wiimote speaker yet. shagkur has recently added some basic speaker functionality to libogc svn, but...I can&#039;t guarantee you what state it&#039;s in.]]></description>
<dc:creator>Tantric</dc:creator>
<category>Coding</category><pubDate>Fri, 26 Jun 2009 18:58:33 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,21200#msg-21200</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,21200#msg-21200</link><description><![CDATA[ I thought that libasnd could do realtime pcm to pcm conversation for you? Maybe I was wrong in thinking that, I haven&#039;t tried to use it yet.]]></description>
<dc:creator>henke37</dc:creator>
<category>Coding</category><pubDate>Thu, 18 Jun 2009 22:21:39 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,21166#msg-21166</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,21166#msg-21166</link><description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>henke37</strong><br />Wav can store that exact format btw. Or it might contain mp3 audio, it&#039;s just a container!</div></blockquote><br />But a .wav file typically has a header - the raw sample data required here ("PCM") does not. So no, a typical wave file will <b>not</b> work here - you need it converted, probably not just the header stripped but <b>also converted to 48khz or 32khz</b> (forgot to mention that part!)]]></description>
<dc:creator>Tantric</dc:creator>
<category>Coding</category><pubDate>Thu, 18 Jun 2009 17:46:25 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,21164#msg-21164</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,21164#msg-21164</link><description><![CDATA[ Ok!<br /><br />Do you know of any app, that I can look at, that uses the wiimote speakers?]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Thu, 18 Jun 2009 16:04:23 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,21162#msg-21162</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,21162#msg-21162</link><description><![CDATA[ Nope]]></description>
<dc:creator>henke37</dc:creator>
<category>Coding</category><pubDate>Thu, 18 Jun 2009 15:56:07 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,21158#msg-21158</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,21158#msg-21158</link><description><![CDATA[ Thanks! That worked well!<br /><br />Now I want to make use off the wiimote speakers! I searched the wiki and all i found was this:<br /><br /><blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />Speaker<br /><br />The Wii Remote has a small low-quality 21mm piezo-electric speaker, used for short sound effects during gameplay. The sound is streamed directly from the host, and the speaker has some adjustable parameters.<br />The speaker is controlled by using three output reports, together with a section of the register address space of the Wii Remote.<br />Report 0x14 is used to enable or disable the speaker. Setting bit 2 will enable the speaker, and clearing it will disable it. For example, to enable the speaker, send:<br />(52) 14 04<br />Report 0x19 is used to mute or unmute the speaker, and works identically to report 0x14. 0x04 will mute the speaker, and 0x00 will unmute it.<br />Report 0x18 is used to send speaker data. 1-20 bytes may be sent at once:<br />(52) 18 LL DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD<br />LL specifies the data length, shifted left by three bits. The DD bytes are the speaker data. To fullfill the report length requirements, the data must be padded if it is less than 20 bytes long. Sound data must be sent at the proper rate.<br />Initialization Sequence<br />Reminder<br />Remember to set bit 2 (0x04) on the first byte of the Output Reports to write to registers!<br />The following sequence will initialize the speaker:<br />Enable speaker (Send 0x04 to Output Report 0x14)<br />Mute speaker (Send 0x04 to Output Report 0x19)<br />Write 0x01 to register 0xa20009<br />Write 0x08 to register 0xa20001<br />Write 7-byte configuration to registers 0xa20001-0xa20008<br />Write 0x01 to register 0xa20008<br />Unmute speaker (Send 0x00 to Output Report 0x19)<br />Speaker Configuration<br />7 bytes control the speaker settings, including volume. The full purpose of these bytes is not known, but the following values seem to produce some sound:<br />00 FF RR RR VV 00 00<br />RR RR specify the sample rate (little-endian format), using the following formulae:<br />pcm_sample_rate = 12000000 / rate_value adpcm_sample_rate = 6000000 / rate_value<br />The standard value is 0x7d0, for 3000Hz 4-bit PCM<br />FF configures the data format. Setting it to 0x40 configures the speaker to use signed 8-bit PCM, while setting it to 0x00 configures it to use 4-bit Yamaha ADPCM. VV specifies the volume, which has a range of 0x00-0xFF for 8-bit mode, and 0x00-0x40 for 4-bit mode.<br />This configuration can be used to play 4-bit ADPCM sound at 3000Hz:<br />00 00 D0 07 40 00 00<br />This configuration can be used to play 8-bit PCM sound at 1500Hz sample rate:<br />00 40 40 1f 40 00 00</div></blockquote><br />at this page: [<a href="http://www.wiibrew.org/wiki/Wiimote#Speaker" rel="nofollow">www.wiibrew.org</a>]<br /><br />Since I don&#039;t quite understand the inforemation I found, I wonder if there already is a lib for playing sounds through the wiimote speaker?]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Thu, 18 Jun 2009 15:24:58 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,21079#msg-21079</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,21079#msg-21079</link><description><![CDATA[ Wav can store that exact format btw. Or it might contain mp3 audio, it&#039;s just a container!]]></description>
<dc:creator>henke37</dc:creator>
<category>Coding</category><pubDate>Wed, 17 Jun 2009 23:55:19 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,21038#msg-21038</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,21038#msg-21038</link><description><![CDATA[ I use GoldWave. You want 16 bit big endian stereo (I believe GoldWave calls it RAW)]]></description>
<dc:creator>Tantric</dc:creator>
<category>Coding</category><pubDate>Wed, 17 Jun 2009 18:54:17 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,21000#msg-21000</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,21000#msg-21000</link><description><![CDATA[ Anyone know of any good wav to pcm converters?]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Wed, 17 Jun 2009 15:30:58 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20987#msg-20987</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20987#msg-20987</link><description><![CDATA[ Yes, I noticed libwiigui doing that.<br />Yes, I will also try doing that.<br /><br />Thanks for all the help, everyone! :D]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Wed, 17 Jun 2009 12:03:02 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20980#msg-20980</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20980#msg-20980</link><description><![CDATA[ oggplayer is set to use voice channel 0 always, if you want multiple ones you would have to recode the oggplayer. Basically it was intended for background music, if you want short sound effects you should be using something like pcm.<br /><br />You can have ogg for the music and pcm for sound effects, that&#039;s what libwiigui is doing.]]></description>
<dc:creator>Tantric</dc:creator>
<category>Coding</category><pubDate>Wed, 17 Jun 2009 08:33:26 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20883#msg-20883</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20883#msg-20883</link><description><![CDATA[ That fixed the problem!<br />Thanks alot everyone!<br /><br />The problem is now, I can&#039;t play multiple sounds at a time.<br />Is it even possilbe to do that with oggplayer?]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Tue, 16 Jun 2009 14:50:35 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20869#msg-20869</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20869#msg-20869</link><description><![CDATA[ That would be a linking error.<br />You should generally keep the platform runtime library and libmath at the end of the linking list, since they are most likely to be used by other libraries.]]></description>
<dc:creator>henke37</dc:creator>
<category>Coding</category><pubDate>Tue, 16 Jun 2009 11:59:12 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20847#msg-20847</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20847#msg-20847</link><description><![CDATA[ I believe putting -lasnd before -logc will fix your compilation error.]]></description>
<dc:creator>Tantric</dc:creator>
<category>Coding</category><pubDate>Tue, 16 Jun 2009 06:41:13 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20800#msg-20800</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20800#msg-20800</link><description><![CDATA[ @speewave: Yes I have considered to do it that way, but I&#039;d like to keep things "clean" if you know what I mean. Thanks for the tip though and thanks for telling me about the multiple occurances!]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Mon, 15 Jun 2009 19:57:25 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20791#msg-20791</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20791#msg-20791</link><description><![CDATA[ The bg_music_ogg.length idea came from a misreading. In the libwiigui example length is a parameter and i thought it was a function to check how long an array is. (I think you always can do that in Java).<br /><br />At first I couln&#039;t compile it but adding a few libs to the bakefile solved that.<br />These are my current makefile libs:<br /><pre class="bbcode">
LIBS	:=	 -lpng -ljpeg -lz -lfat -lwiiuse -lbte -lfat -logc -lm -lasnd -ltremor</pre><br />Now I can compile it, but still I don&#039;t get any sound when calling PlayOgg(...), so I tried adding SetVolumeOgg(255) right after PlayOgg(...). This didn&#039;t give me a different result.<br /><br />I figured I had to init the audio so I added the following code (copied from the libwiigui example):<br /><br /><pre class="bbcode">
// Initiate audio
AUDIO_Init(NULL);
ASND_Init();
ASND_Pause(0);</pre><br />I also included a couple of files:<br /><br /><pre class="bbcode">
#include "ogcsys.h"
#include "asndlib.h"</pre><br /><br />That gave me an error which I don&#039;t know how to resolve:<br /><br />&gt; "make"<br />linking ... akruve.elf<br />c:/devkitPro/libogc/lib/wii\libasnd.a(asndlib.o): In function `__dsp_initcallback&#039;:<br />asndlib.c:(.text.__dsp_initcallback+0x10): undefined reference to `DSP_SendMailTo&#039;<br />asndlib.c:(.text.__dsp_initcallback+0x14): undefined reference to `DSP_CheckMailTo&#039;<br />asndlib.c:(.text.__dsp_initcallback+0x2c): undefined reference to `DSP_SendMailTo&#039;<br />asndlib.c:(.text.__dsp_initcallback+0x30): undefined reference to `DSP_CheckMailTo&#039;<br />c:/devkitPro/libogc/lib/wii\libasnd.a(asndlib.o): In function `__dsp_requestcallback&#039;:<br />asndlib.c:(.text.__dsp_requestcallback+0x218): undefined reference to `DSP_SendMailTo&#039;<br />asndlib.c:(.text.__dsp_requestcallback+0x21c): undefined reference to `DSP_CheckMailTo&#039;<br />asndlib.c:(.text.__dsp_requestcallback+0x468): undefined reference to `DSP_SendMailTo&#039;<br />asndlib.c:(.text.__dsp_requestcallback+0x46c): undefined reference to `DSP_CheckMailTo&#039;<br />c:/devkitPro/libogc/lib/wii\libasnd.a(asndlib.o): In function `audio_dma_callback&#039;:<br />asndlib.c:(.text.audio_dma_callback+0x27c): undefined reference to `DSP_SendMailTo&#039;<br />asndlib.c:(.text.audio_dma_callback+0x280): undefined reference to `DSP_CheckMailTo&#039;<br />c:/devkitPro/libogc/lib/wii\libasnd.a(asndlib.o): In function `ASND_Init&#039;:<br />asndlib.c:(.text.ASND_Init+0x1c): undefined reference to `DSP_Init&#039;<br />asndlib.c:(.text.ASND_Init+0x18c): undefined reference to `DSP_AddTask&#039;<br />collect2: ld returned 1 exit status<br />make[1]: *** [/c/Projects/wii/akruve/akruve.elf] Error 1<br />"make": *** [build] Error 2<br /><br />&gt; Process Exit Code: 2<br />&gt; Time Taken: 00:00<br /><br />What do I have to do to add references to those functions?]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Mon, 15 Jun 2009 18:49:50 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20789#msg-20789</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20789#msg-20789</link><description><![CDATA[ i became very frustrated with the loading ogg from source, so i decided to start using the FAT system for SD Cards:<br /><br />just add the "fat.h" header<br />add fatInitDefault(); to source code<br /><br /><br />btw&lt; in the posted makefile you have 2 occurances or "-lfat"]]></description>
<dc:creator>speewave</dc:creator>
<category>Coding</category><pubDate>Mon, 15 Jun 2009 18:39:58 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20763#msg-20763</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20763#msg-20763</link><description><![CDATA[ add this after BINFILES:<br /><br /><pre class="bbcode">
OGGFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ogg)))</pre><br />This will automatically look for ogg files in the given directory.<br />Be sure to put your ogg files in the /data directory.<br />If you got the idea you can put them elsewhere and modify the Makefile in regard.<br /><br />Then change<br /><pre class="bbcode">
export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
					$(sFILES:.s=.o) $(SFILES:.S=.o)</pre><br />into<br /><pre class="bbcode">

export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
					$(sFILES:.s=.o) $(SFILES:.S=.o) $(OGGFILES:.ogg=.ogg.o</pre><br />This will automatically generate the .o and .h files for each OGG.<br /><br /><br />About your error:<br /><pre class="bbcode">

PlayOgg(mem_open((char *)bg_music_ogg,C), 0, OGG_INFINITE_TIME);</pre><br />should be<br /><br /><pre class="bbcode">
PlayOgg(mem_open((char *)bg_music_ogg,bg_music_ogg_size), 0, OGG_INFINITE_TIME);</pre><br />bg_music_ogg is not a structure, it is a buffer<br />the buffer length is declared as another variable wich is xxxxx_og_size.<br />where does this bg_music_ogg.length idea comes from ?<br /><br />PS: as a general advice, pay good attention to the compiler warnings/errors and try to understand what they mean, it&#039;s good learning practice]]></description>
<dc:creator>ekeeke</dc:creator>
<category>Coding</category><pubDate>Mon, 15 Jun 2009 11:53:11 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20737#msg-20737</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20737#msg-20737</link><description><![CDATA[ It is not becoming auto genereted. I have checked the build folder and it&#039;s not there.<br />I can&#039;t even see it in the sfx folder in programmers notepad, and I have checked it really is there.<br /><br />I "cheated" and borrowed the bg_music_ogg.h from the libwiigui example and then I could not use the PlayOgg(...) function.<br />I used it as it is being used in the libwiigui example. That is, as far as I can understand, like this:<br /><br /><pre class="bbcode">
PlayOgg(mem_open((char *)bg_music_ogg,bg_music_ogg.length), 0, OGG_INFINITE_TIME);</pre><br />And got an error like this:<br /><br />&gt; "make"<br />main.cpp<br />c:/Projects/wii/akruve/source/main.cpp: In function &#039;int main(int, char**)&#039;:<br />c:/Projects/wii/akruve/source/main.cpp:29: error: invalid use of array with unspecified bounds<br />make[1]: *** [main.o] Error 1<br />"make": *** [build] Error 2<br /><br />&gt; Process Exit Code: 2<br />&gt; Time Taken: 00:00<br /><br /><br /><br />My 2 questions are:<br /><br />What do I exactly have to do to make my program auto generate a bg_music_ogg.h?<br /><br />and<br /><br />How do I properly use the function PlayOgg(...) from oggplayer.c?]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Mon, 15 Jun 2009 01:20:59 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20719#msg-20719</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20719#msg-20719</link><description><![CDATA[ Just include the auto generated headerfile and get the right defentions for free.]]></description>
<dc:creator>henke37</dc:creator>
<category>Coding</category><pubDate>Sun, 14 Jun 2009 23:17:32 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20706#msg-20706</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20706#msg-20706</link><description><![CDATA[ OK!<br /><br />I have got the file inside folder_of_the_app\sfx<br /><br />It doesn&#039;t just show up in programmers notepad and can&#039;t be accessed through extern const u8 myfile_ogg[] or size...<br />What might be wrong then?<br /><br />My makefile looks like this:<br /><br /><pre class="bbcode">
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC)
endif

include $(DEVKITPPC)/wii_rules

#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
GRRLIB		:=	source/GRRLIB
TARGET		:=	$(notdir $(CURDIR))
BUILD		:=	build
SOURCES		:=	source source/gfx $(GRRLIB)/GRRLIB $(GRRLIB)/lib/libpng/pngu
DATA		:=	data  
INCLUDES	:=

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGS	= -g -O2 -mrvl -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS	=	$(CFLAGS)

LDFLAGS	=	-g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS	:=	 -lpng -ljpeg -lz -lfat -lwiiuse -lbte -lfat -logc -lm

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS	:= $(CURDIR)/$(GRRLIB)

#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUT	:=	$(CURDIR)/$(TARGET)

export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
					$(foreach dir,$(DATA),$(CURDIR)/$(dir))

export DEPSDIR	:=	$(CURDIR)/$(BUILD)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
	export LD	:=	$(CC)
else
	export LD	:=	$(CXX)
endif

export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
					$(sFILES:.s=.o) $(SFILES:.S=.o)

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE	:=	$(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
					-I$(CURDIR)/$(BUILD) \
					-I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
					-L$(LIBOGC_LIB)

export OUTPUT	:=	$(CURDIR)/$(TARGET)
.PHONY: $(BUILD) clean

#---------------------------------------------------------------------------------
$(BUILD):
	@[ -d $@ ] || mkdir -p $@
	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile

#---------------------------------------------------------------------------------
clean:
	@echo clean ...
	@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol

#---------------------------------------------------------------------------------
run:
	wiiload $(TARGET).dol

#---------------------------------------------------------------------------------
reload:
	psoload -r $(TARGET).dol


#---------------------------------------------------------------------------------
else

DEPENDS	:=	$(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

#---------------------------------------------------------------------------------
# This rule links in binary data with the .jpg extension
#---------------------------------------------------------------------------------
%.jpg.o	:	%.jpg
#---------------------------------------------------------------------------------
	@echo $(notdir $&lt;)
	$(bin2o)

#-include $(DEPENDS)
#---------------------------------------------------------------------------------
# This rule links in binary data with the .ogg extension
#---------------------------------------------------------------------------------
%.ogg.o :	%.ogg
#---------------------------------------------------------------------------------
	@echo $(notdir $&lt;)
	$(bin2o)
	
-include $(DEPENDS)

#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------</pre><br />And I get this error when I try to compile:<br /><br />&gt; "make"<br />main.cpp<br />c:/Projects/wii/akruve/source/main.cpp: In function &#039;int main(int, char**)&#039;:<br />c:/Projects/wii/akruve/source/main.cpp:31: error: invalid use of array with unspecified bounds<br />make[1]: *** [main.o] Error 1<br />"make": *** [build] Error 2<br /><br />&gt; Process Exit Code: 2<br />&gt; Time Taken: 00:01]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Sun, 14 Jun 2009 20:33:02 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20702#msg-20702</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20702#msg-20702</link><description><![CDATA[ If your makefile is set up right, then myfile.ogg will be automatically included, and you just need to access it with:<br /><br />extern const u8 myfile_ogg[];<br />extern const u32 myfile_ogg_size;<br /><br />function myFunction()<br />{<br />// use the variables here<br />}]]></description>
<dc:creator>Tantric</dc:creator>
<category>Coding</category><pubDate>Sun, 14 Jun 2009 19:59:29 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,19812,20638#msg-20638</guid>
<title>Re: Playing Sounds</title><link>http://forum.wiibrew.org/read.php?11,19812,20638#msg-20638</link><description><![CDATA[ Ok! I think I have understodd everything except how I do get the sound file to be stored in an array, like bg_music_ogg[] and it&#039;s size in bg_music_ogg_size.<br /><br />I have added this makefile rule:<br /><br /><pre class="bbcode">
#---------------------------------------------------------------------------------
# This rule links in binary data with the .ogg extension
#---------------------------------------------------------------------------------
%.ogg.o :	%.ogg
#---------------------------------------------------------------------------------
	@echo $(notdir $&lt;)
	$(bin2o)
	
-include $(DEPENDS)</pre>
But, as I mentioned, I don&#039;t know how to get access to the sound buffer (or what it is...).]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Sun, 14 Jun 2009 13:39:09 +0200</pubDate></item>
</channel>
</rss>