<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dwe</id>
	<title>3dbrew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dwe"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Dwe"/>
	<updated>2026-04-17T20:00:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Nintendo_3DS_Sound&amp;diff=6329</id>
		<title>Nintendo 3DS Sound</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Nintendo_3DS_Sound&amp;diff=6329"/>
		<updated>2013-05-30T00:17:21Z</updated>

		<summary type="html">&lt;p&gt;Dwe: /* Sample reader */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Nintendo 3DS Sound is the music playing and audio recording application that is included with all retail consoles.&lt;br /&gt;
&lt;br /&gt;
It loads audio files from the sd card. It supports MP3 and AAC encoded audio files and supports m3u playlists.&lt;br /&gt;
&lt;br /&gt;
== Playlist file format==&lt;br /&gt;
The application allows for user created playlists. They are stored on the SD card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x04&lt;br /&gt;
| Magic bytes, &#039;O&#039;, &#039;V&#039;, &#039;A&#039;, &#039;F&#039; or &amp;quot;FAVO&amp;quot; endian corrected.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0x04&lt;br /&gt;
| Always integer with value 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| 0x04&lt;br /&gt;
| Seems static?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C&lt;br /&gt;
| 0x04&lt;br /&gt;
| Zero Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x02&lt;br /&gt;
| checksum (songs?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x02&lt;br /&gt;
| Icon ID (0-44)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x02&lt;br /&gt;
| Song file count&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x02&lt;br /&gt;
| static(?) 2C 01&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x04&lt;br /&gt;
| some kind of timestamp, for encryption (dosn&#039;t change when editing)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0x01&lt;br /&gt;
| checksum (icon?, header?) (dosn&#039;t change when editing)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B&lt;br /&gt;
| 0x01&lt;br /&gt;
| checksum (name?) (dosn&#039;t change when editing)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x04&lt;br /&gt;
| always(?) integer with value 6&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x100 (avaiable 0x40)&lt;br /&gt;
| Playlist name stored in UTF-16&lt;br /&gt;
|-&lt;br /&gt;
| 0x120+(n*0x20C) =&amp;gt; n&amp;lt;300&lt;br /&gt;
| 692 (0x20C per song)&lt;br /&gt;
| File name stored in UTF-16. Repeats for the rest of the file.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2672F&lt;br /&gt;
| -&lt;br /&gt;
| End&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Sample reader ==&lt;br /&gt;
This is a basic example of how to read a 3DS playlist. I know that this works on my specific system; on any other system, it&#039;s liable to fail. I&#039;m not responsible if you hurt yourself.&lt;br /&gt;
&amp;lt;pre&amp;gt;/* This is free and unencumbered software released into the public domain.&lt;br /&gt;
/* Anyone is free to copy, modify, publish, use, compile, sell, or&lt;br /&gt;
/* distribute this software, either in source code form or as a compiled&lt;br /&gt;
/* binary, for any purpose, commercial or non-commercial, and by any&lt;br /&gt;
/* means.&lt;br /&gt;
&lt;br /&gt;
/* In jurisdictions that recognize copyright laws, the author or authors&lt;br /&gt;
/* of this software dedicate any and all copyright interest in the&lt;br /&gt;
/* software to the public domain. We make this dedication for the benefit&lt;br /&gt;
/* of the public at large and to the detriment of our heirs and&lt;br /&gt;
/* successors. We intend this dedication to be an overt act of&lt;br /&gt;
/* relinquishment in perpetuity of all present and future rights to this&lt;br /&gt;
/* software under copyright law.&lt;br /&gt;
/* &lt;br /&gt;
/* THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND,&lt;br /&gt;
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF&lt;br /&gt;
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.&lt;br /&gt;
/* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR&lt;br /&gt;
/* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,&lt;br /&gt;
/* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR&lt;br /&gt;
/* OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
/*&lt;br /&gt;
/* For more information, please refer to &amp;lt;http://unlicense.org/&amp;gt; */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
uint8_t buf[0x26730];&lt;br /&gt;
uint16_t checksum, icon, songCount;&lt;br /&gt;
uint32_t timestamp;&lt;br /&gt;
uint8_t playlistName[0x100];&lt;br /&gt;
uint8_t songName[0x20C][299];&lt;br /&gt;
&lt;br /&gt;
void readUtf16AsAscii(uint8_t *input, uint8_t *output, uint16_t length, uint32_t offset) {&lt;br /&gt;
	uint16_t j=0;&lt;br /&gt;
	for (j=0; j&amp;lt;length; j++) {&lt;br /&gt;
		output[j] = input[(j*2)+offset];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[]) {&lt;br /&gt;
	uint16_t t=0;&lt;br /&gt;
	FILE *playlistFile;&lt;br /&gt;
&lt;br /&gt;
	if (argc != 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: %s FILE\n&amp;quot;, argv[0]);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ((playlistFile = fopen(argv[1], &amp;quot;rb&amp;quot;)) == NULL) {&lt;br /&gt;
		printf(&amp;quot;Could not open %s.\n&amp;quot;, argv[1]);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if (fread(buf, 1, 0x26730, playlistFile) != 0x26730) {&lt;br /&gt;
		printf(&amp;quot;Could not 0x26730 bytes from %s.\n&amp;quot;, argv[1]);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if (!((buf[0] = &#039;O&#039;) &amp;amp;&amp;amp; (buf[1] = &#039;V&#039;) &amp;amp;&amp;amp; (buf[2] = &#039;F&#039;) &amp;amp;&amp;amp; (buf[3] = &#039;A&#039;))) {&lt;br /&gt;
		printf(&amp;quot;%s is not a 3DS playlist file.\n&amp;quot;, argv[1]);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	checksum  = (buf[0x11] &amp;lt;&amp;lt; 8)  | buf[0x10];&lt;br /&gt;
	icon      = (buf[0x13] &amp;lt;&amp;lt; 8)  | buf[0x12];&lt;br /&gt;
	songCount = (buf[0x15] &amp;lt;&amp;lt; 8)  | buf[0x14];&lt;br /&gt;
	timestamp = (buf[0x17] &amp;lt;&amp;lt; 24) | (buf[0x16] &amp;lt;&amp;lt; 16) | (buf[0x19] &amp;lt;&amp;lt; 8) | buf[0x18];&lt;br /&gt;
	readUtf16AsAscii(buf, playlistName, 0x100, 0x20);&lt;br /&gt;
	for (t=0; t&amp;lt;songCount; t++) readUtf16AsAscii(buf, songName[t], 0x20C, (0x120+(t*0x20C)));&lt;br /&gt;
&lt;br /&gt;
	printf(&amp;quot;Checksum:\t%04X\nIcon ID:\t%04X\nSong Count:\t%04X\nTimestamp:\t%08X\nPlaylist Name:\t\&amp;quot;%s\&amp;quot;\n&amp;quot;,&lt;br /&gt;
	checksum, icon, songCount, timestamp, playlistName);&lt;br /&gt;
&lt;br /&gt;
	for (t=0; t&amp;lt;songCount; t++) printf(&amp;quot;Name of song %03i: %s\n&amp;quot;, t, songName[t]);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:File formats]]&lt;br /&gt;
[[Category:Nintendo Software]]&lt;/div&gt;</summary>
		<author><name>Dwe</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Nintendo_3DS_Sound&amp;diff=6328</id>
		<title>Nintendo 3DS Sound</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Nintendo_3DS_Sound&amp;diff=6328"/>
		<updated>2013-05-30T00:16:56Z</updated>

		<summary type="html">&lt;p&gt;Dwe: Added a sample implementation of a reader in C&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Nintendo 3DS Sound is the music playing and audio recording application that is included with all retail consoles.&lt;br /&gt;
&lt;br /&gt;
It loads audio files from the sd card. It supports MP3 and AAC encoded audio files and supports m3u playlists.&lt;br /&gt;
&lt;br /&gt;
== Playlist file format==&lt;br /&gt;
The application allows for user created playlists. They are stored on the SD card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x04&lt;br /&gt;
| Magic bytes, &#039;O&#039;, &#039;V&#039;, &#039;A&#039;, &#039;F&#039; or &amp;quot;FAVO&amp;quot; endian corrected.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0x04&lt;br /&gt;
| Always integer with value 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| 0x04&lt;br /&gt;
| Seems static?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C&lt;br /&gt;
| 0x04&lt;br /&gt;
| Zero Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x02&lt;br /&gt;
| checksum (songs?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x02&lt;br /&gt;
| Icon ID (0-44)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x02&lt;br /&gt;
| Song file count&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x02&lt;br /&gt;
| static(?) 2C 01&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x04&lt;br /&gt;
| some kind of timestamp, for encryption (dosn&#039;t change when editing)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0x01&lt;br /&gt;
| checksum (icon?, header?) (dosn&#039;t change when editing)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B&lt;br /&gt;
| 0x01&lt;br /&gt;
| checksum (name?) (dosn&#039;t change when editing)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x04&lt;br /&gt;
| always(?) integer with value 6&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x100 (avaiable 0x40)&lt;br /&gt;
| Playlist name stored in UTF-16&lt;br /&gt;
|-&lt;br /&gt;
| 0x120+(n*0x20C) =&amp;gt; n&amp;lt;300&lt;br /&gt;
| 692 (0x20C per song)&lt;br /&gt;
| File name stored in UTF-16. Repeats for the rest of the file.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2672F&lt;br /&gt;
| -&lt;br /&gt;
| End&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Sample reader ==&lt;br /&gt;
This is a basic example of how to read a 3DS playlist. I know that this works on my specific system; on any other system, it&#039;s liable to fail. I&#039;m not responsible if hurt yourself.&lt;br /&gt;
&amp;lt;pre&amp;gt;/* This is free and unencumbered software released into the public domain.&lt;br /&gt;
/* Anyone is free to copy, modify, publish, use, compile, sell, or&lt;br /&gt;
/* distribute this software, either in source code form or as a compiled&lt;br /&gt;
/* binary, for any purpose, commercial or non-commercial, and by any&lt;br /&gt;
/* means.&lt;br /&gt;
&lt;br /&gt;
/* In jurisdictions that recognize copyright laws, the author or authors&lt;br /&gt;
/* of this software dedicate any and all copyright interest in the&lt;br /&gt;
/* software to the public domain. We make this dedication for the benefit&lt;br /&gt;
/* of the public at large and to the detriment of our heirs and&lt;br /&gt;
/* successors. We intend this dedication to be an overt act of&lt;br /&gt;
/* relinquishment in perpetuity of all present and future rights to this&lt;br /&gt;
/* software under copyright law.&lt;br /&gt;
/* &lt;br /&gt;
/* THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND,&lt;br /&gt;
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF&lt;br /&gt;
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.&lt;br /&gt;
/* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR&lt;br /&gt;
/* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,&lt;br /&gt;
/* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR&lt;br /&gt;
/* OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
/*&lt;br /&gt;
/* For more information, please refer to &amp;lt;http://unlicense.org/&amp;gt; */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
uint8_t buf[0x26730];&lt;br /&gt;
uint16_t checksum, icon, songCount;&lt;br /&gt;
uint32_t timestamp;&lt;br /&gt;
uint8_t playlistName[0x100];&lt;br /&gt;
uint8_t songName[0x20C][299];&lt;br /&gt;
&lt;br /&gt;
void readUtf16AsAscii(uint8_t *input, uint8_t *output, uint16_t length, uint32_t offset) {&lt;br /&gt;
	uint16_t j=0;&lt;br /&gt;
	for (j=0; j&amp;lt;length; j++) {&lt;br /&gt;
		output[j] = input[(j*2)+offset];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[]) {&lt;br /&gt;
	uint16_t t=0;&lt;br /&gt;
	FILE *playlistFile;&lt;br /&gt;
&lt;br /&gt;
	if (argc != 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: %s FILE\n&amp;quot;, argv[0]);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ((playlistFile = fopen(argv[1], &amp;quot;rb&amp;quot;)) == NULL) {&lt;br /&gt;
		printf(&amp;quot;Could not open %s.\n&amp;quot;, argv[1]);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if (fread(buf, 1, 0x26730, playlistFile) != 0x26730) {&lt;br /&gt;
		printf(&amp;quot;Could not 0x26730 bytes from %s.\n&amp;quot;, argv[1]);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if (!((buf[0] = &#039;O&#039;) &amp;amp;&amp;amp; (buf[1] = &#039;V&#039;) &amp;amp;&amp;amp; (buf[2] = &#039;F&#039;) &amp;amp;&amp;amp; (buf[3] = &#039;A&#039;))) {&lt;br /&gt;
		printf(&amp;quot;%s is not a 3DS playlist file.\n&amp;quot;, argv[1]);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	checksum  = (buf[0x11] &amp;lt;&amp;lt; 8)  | buf[0x10];&lt;br /&gt;
	icon      = (buf[0x13] &amp;lt;&amp;lt; 8)  | buf[0x12];&lt;br /&gt;
	songCount = (buf[0x15] &amp;lt;&amp;lt; 8)  | buf[0x14];&lt;br /&gt;
	timestamp = (buf[0x17] &amp;lt;&amp;lt; 24) | (buf[0x16] &amp;lt;&amp;lt; 16) | (buf[0x19] &amp;lt;&amp;lt; 8) | buf[0x18];&lt;br /&gt;
	readUtf16AsAscii(buf, playlistName, 0x100, 0x20);&lt;br /&gt;
	for (t=0; t&amp;lt;songCount; t++) readUtf16AsAscii(buf, songName[t], 0x20C, (0x120+(t*0x20C)));&lt;br /&gt;
&lt;br /&gt;
	printf(&amp;quot;Checksum:\t%04X\nIcon ID:\t%04X\nSong Count:\t%04X\nTimestamp:\t%08X\nPlaylist Name:\t\&amp;quot;%s\&amp;quot;\n&amp;quot;,&lt;br /&gt;
	checksum, icon, songCount, timestamp, playlistName);&lt;br /&gt;
&lt;br /&gt;
	for (t=0; t&amp;lt;songCount; t++) printf(&amp;quot;Name of song %03i: %s\n&amp;quot;, t, songName[t]);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:File formats]]&lt;br /&gt;
[[Category:Nintendo Software]]&lt;/div&gt;</summary>
		<author><name>Dwe</name></author>
	</entry>
</feed>