Skip to content

Commit d402f38

Browse files
mp3 docs
1 parent 0a3de12 commit d402f38

File tree

523 files changed

+2882
-2791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

523 files changed

+2882
-2791
lines changed

docpages/basic-language-reference/BASIC_SOUND.md

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44

55
## Audio System Structure
66

7-
Retro Rocket’s audio system has three main parts:
7+
Retro Rocket’s audio system has four main parts:
88

99
### Drivers
1010

11-
The driver is the low-level hardware backend (e.g. `MODLOAD "ac97"`).
11+
The driver is the low-level hardware backend (e.g. `MODLOAD "ac97"`).
1212
It is specific to your sound card in your PC. Without a driver, **no audio commands will work**.
1313

14+
### Codecs
15+
16+
A codec is a small specialised program that knows how to **decode audio files** into the raw data format used by Retro Rocket.
17+
Codecs are provided as kernel modules, just like drivers, and must be loaded before you can use them.
18+
19+
* WAV support is built in and always available.
20+
* MP3 support is available via the `mp3.ko` module (`MODLOAD "mp3"`).
21+
22+
If you try to load an MP3 file without first loading the MP3 codec module, you will receive an error as the file type will be unrecognised.
1423

1524
### Streams
1625

@@ -20,37 +29,50 @@ A stream is a **playback channel** created with `STREAM CREATE`.
2029
* Multiple streams can run at once (for mixing music, effects, voices, etc.).
2130
* A stream handle is always a positive integer ID.
2231

23-
2432
### Sounds
2533

2634
A sound is **decoded audio data** loaded into memory with `SOUND LOAD`.
2735

28-
* Sounds can be loaded from any .WAV file which contains PCM or FLOAT format audio.
36+
* Sounds can be loaded from any supported codec (e.g. WAV, MP3).
2937
* Sounds are stored in RAM as 44.1 kHz stereo, 16-bit PCM.
3038
* Sound handles are always non-zero integer IDs.
3139
* Sounds must be freed with `SOUND UNLOAD` when no longer needed.
3240

33-
3441
## Flow of audio
3542

3643
```
37-
File on disk (WAV) → SOUND LOAD → Sound handle
44+
File on disk (WAV/MP3/other) → Codec module decodes → SOUND LOAD → Sound handle
3845
Sound handle + Stream → SOUND PLAY → Playback
3946
```
4047

41-
## Example
48+
## Examples
49+
50+
### Play a WAV file
4251

4352
```basic
44-
MODLOAD "ac97" ' load audio driver
45-
STREAM CREATE music ' create playback channel
46-
SOUND LOAD song, "track.wav" ' load audio into RAM
47-
SOUND PLAY music, song ' play on stream
53+
MODLOAD "ac97" ' load audio driver
54+
STREAM CREATE music
55+
SOUND LOAD song, "track.wav"
56+
SOUND PLAY music, song
4857
```
4958

5059
\image html sound.png
5160

61+
### Play an MP3 file
62+
63+
```basic
64+
MODLOAD "ac97" ' load audio driver
65+
MODLOAD "mp3" ' load MP3 codec module
66+
STREAM CREATE music
67+
SOUND LOAD song, "track.mp3"
68+
SOUND PLAY music, song
69+
```
70+
71+
\image html mp3.png
72+
5273
## Audio Keywords/Functions
5374

54-
- \ref STREAM "STREAM"
55-
- \ref STREAM "SOUND"
56-
- \ref DECIBELS "DECIBELS"
75+
* \ref STREAM "STREAM"
76+
* \ref STREAM "SOUND"
77+
* \ref DECIBELS "DECIBELS"
78+

docpages/images/mp3.png

11 KB
Loading

docs/ABS.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@
9292
<div class="textblock"><div class="fragment"><div class="line">ABS(numeric-expression)</div>
9393
</div><!-- fragment --><p>Returns the <b>absolute value</b> of a numeric expression. Negative values are converted to positive; positive values remain unchanged.</p>
9494
<hr />
95-
<h3><a class="anchor" id="autotoc_md66"></a>
95+
<h3><a class="anchor" id="autotoc_md69"></a>
9696
How to read it</h3>
9797
<ul>
9898
<li>For integers: <code>ABS(-5)</code> becomes <code>5</code>.</li>
9999
<li>For reals: <code>ABS(-3.14)</code> becomes <code>3.14</code>.</li>
100100
<li>Zero always remains <code>0</code>.</li>
101101
</ul>
102102
<hr />
103-
<h3><a class="anchor" id="autotoc_md68"></a>
103+
<h3><a class="anchor" id="autotoc_md71"></a>
104104
Examples</h3>
105105
<div class="fragment"><div class="line">PRINT ABS(-42)</div>
106106
</div><!-- fragment --><p>This example produces <code>42</code>.</p>
@@ -112,7 +112,7 @@ <h3><a class="anchor" id="autotoc_md68"></a>
112112
<div class="line"> PRINT &quot;Distance: &quot;; ABS(x)</div>
113113
<div class="line">NEXT</div>
114114
</div><!-- fragment --><hr />
115-
<h3><a class="anchor" id="autotoc_md70"></a>
115+
<h3><a class="anchor" id="autotoc_md73"></a>
116116
Notes</h3>
117117
<ul>
118118
<li>Works with both <b>integers</b> and <b>reals</b>.</li>
@@ -128,7 +128,7 @@ <h3><a class="anchor" id="autotoc_md70"></a>
128128
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
129129
<ul>
130130
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="int-funcs.html">Integer Functions</a></li>
131-
<li class="footer">Generated on Thu Sep 18 2025 00:15:35 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
131+
<li class="footer">Generated on Thu Sep 18 2025 21:16:10 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
132132
</ul>
133133
</div>
134134
</body>

docs/ACS.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<div class="textblock"><div class="fragment"><div class="line">ACS(real-expression)</div>
9393
</div><!-- fragment --><p>Returns the <b>arc cosine</b> (inverse cosine) of the given expression, in <b>radians</b>. The input must be between <code>-1</code> and <code>1</code>.</p>
9494
<hr />
95-
<h3><a class="anchor" id="autotoc_md454"></a>
95+
<h3><a class="anchor" id="autotoc_md457"></a>
9696
Examples</h3>
9797
<div class="fragment"><div class="line">PRINT ACS(1)</div>
9898
</div><!-- fragment --><p>Produces <code>0</code>.</p>
@@ -105,7 +105,7 @@ <h3><a class="anchor" id="autotoc_md454"></a>
105105
<div class="line">PRINT ACS(COS(angle#))</div>
106106
</div><!-- fragment --><p>Produces the original angle (within floating point accuracy).</p>
107107
<hr />
108-
<h3><a class="anchor" id="autotoc_md456"></a>
108+
<h3><a class="anchor" id="autotoc_md459"></a>
109109
Notes</h3>
110110
<ul>
111111
<li>Argument range: <code>-1 ≤ x ≤ 1</code>. Values outside this range cause an error.</li>
@@ -126,7 +126,7 @@ <h3><a class="anchor" id="autotoc_md456"></a>
126126
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
127127
<ul>
128128
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="real-funcs.html">Real Functions</a></li>
129-
<li class="footer">Generated on Thu Sep 18 2025 00:15:35 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
129+
<li class="footer">Generated on Thu Sep 18 2025 21:16:10 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
130130
</ul>
131131
</div>
132132
</body>

docs/ASC.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<div class="textblock"><div class="fragment"><div class="line">ASC(string-expression)</div>
9393
</div><!-- fragment --><p>Returns the <b>ASCII code</b> of the first character in <code>string-expression</code>.</p>
9494
<hr />
95-
<h3><a class="anchor" id="autotoc_md73"></a>
95+
<h3><a class="anchor" id="autotoc_md76"></a>
9696
Examples</h3>
9797
<div class="fragment"><div class="line">PRINT ASC(&quot;A&quot;)</div>
9898
</div><!-- fragment --><p>This example produces <code>65</code>.</p>
@@ -106,7 +106,7 @@ <h3><a class="anchor" id="autotoc_md73"></a>
106106
<div class="line"> PRINT &quot;You pressed: &quot;; code</div>
107107
<div class="line">ENDIF</div>
108108
</div><!-- fragment --><hr />
109-
<h3><a class="anchor" id="autotoc_md75"></a>
109+
<h3><a class="anchor" id="autotoc_md78"></a>
110110
Notes</h3>
111111
<ul>
112112
<li>Only the <b>first character</b> of the string is considered.</li>
@@ -122,7 +122,7 @@ <h3><a class="anchor" id="autotoc_md75"></a>
122122
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
123123
<ul>
124124
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="int-funcs.html">Integer Functions</a></li>
125-
<li class="footer">Generated on Thu Sep 18 2025 00:15:35 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
125+
<li class="footer">Generated on Thu Sep 18 2025 21:16:10 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
126126
</ul>
127127
</div>
128128
</body>

docs/ASN.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<div class="textblock"><div class="fragment"><div class="line">ASN(real-expression)</div>
9393
</div><!-- fragment --><p>Returns the <b>arc sine</b> (inverse sine) of the given expression, in <b>radians</b>. The input must be between <code>-1</code> and <code>1</code>.</p>
9494
<hr />
95-
<h3><a class="anchor" id="autotoc_md459"></a>
95+
<h3><a class="anchor" id="autotoc_md462"></a>
9696
Examples</h3>
9797
<div class="fragment"><div class="line">PRINT ASN(0)</div>
9898
</div><!-- fragment --><p>Produces <code>0</code>.</p>
@@ -105,7 +105,7 @@ <h3><a class="anchor" id="autotoc_md459"></a>
105105
<div class="line">PRINT ASN(SIN(angle#))</div>
106106
</div><!-- fragment --><p>Produces the original angle (within floating point accuracy).</p>
107107
<hr />
108-
<h3><a class="anchor" id="autotoc_md461"></a>
108+
<h3><a class="anchor" id="autotoc_md464"></a>
109109
Notes</h3>
110110
<ul>
111111
<li>Argument range: <code>-1 ≤ x ≤ 1</code>. Values outside this range cause an error.</li>
@@ -126,7 +126,7 @@ <h3><a class="anchor" id="autotoc_md461"></a>
126126
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
127127
<ul>
128128
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="real-funcs.html">Real Functions</a></li>
129-
<li class="footer">Generated on Thu Sep 18 2025 00:15:35 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
129+
<li class="footer">Generated on Thu Sep 18 2025 21:16:10 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
130130
</ul>
131131
</div>
132132
</body>

docs/ATAN.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
</div><!-- fragment --><p>Returns the <b>arc tangent</b> (inverse tangent) of the given expression, in <b>radians</b>.</p>
9494
<p>The result will always lie between <code>-PI#/2</code> and <code>PI#/2</code>.</p>
9595
<hr />
96-
<h3><a class="anchor" id="autotoc_md464"></a>
96+
<h3><a class="anchor" id="autotoc_md467"></a>
9797
Examples</h3>
9898
<div class="fragment"><div class="line">PRINT ATAN(0)</div>
9999
</div><!-- fragment --><p>Produces <code>0</code>.</p>
@@ -106,7 +106,7 @@ <h3><a class="anchor" id="autotoc_md464"></a>
106106
<div class="line">PRINT ATAN(TAN(angle#))</div>
107107
</div><!-- fragment --><p>Produces the original angle (within floating point accuracy).</p>
108108
<hr />
109-
<h3><a class="anchor" id="autotoc_md466"></a>
109+
<h3><a class="anchor" id="autotoc_md469"></a>
110110
Notes</h3>
111111
<ul>
112112
<li>Input range: any real number is valid.</li>
@@ -123,7 +123,7 @@ <h3><a class="anchor" id="autotoc_md466"></a>
123123
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
124124
<ul>
125125
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="real-funcs.html">Real Functions</a></li>
126-
<li class="footer">Generated on Thu Sep 18 2025 00:15:35 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
126+
<li class="footer">Generated on Thu Sep 18 2025 21:16:10 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
127127
</ul>
128128
</div>
129129
</body>

docs/ATAN2.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<div class="textblock"><div class="fragment"><div class="line">ATAN2(real-y, real-x)</div>
9393
</div><!-- fragment --><p>Returns the <b>arc tangent of y ÷ x</b>, using the signs of both arguments to determine the correct <b>quadrant</b> of the angle. The result is given in <b>radians</b>, in the range <code>-PI#</code> to <code>PI#</code>.</p>
9494
<hr />
95-
<h3><a class="anchor" id="autotoc_md469"></a>
95+
<h3><a class="anchor" id="autotoc_md472"></a>
9696
Examples</h3>
9797
<div class="fragment"><div class="line">PRINT ATAN2(1, 1)</div>
9898
</div><!-- fragment --><p>Produces approximately <code>0.785398</code> (π/4).</p>
@@ -108,7 +108,7 @@ <h3><a class="anchor" id="autotoc_md469"></a>
108108
<div class="line">angle# = ATAN2(dy#, dx#)</div>
109109
<div class="line">PRINT &quot;Angle = &quot;; angle#; &quot; radians&quot;</div>
110110
</div><!-- fragment --><hr />
111-
<h3><a class="anchor" id="autotoc_md471"></a>
111+
<h3><a class="anchor" id="autotoc_md474"></a>
112112
Notes</h3>
113113
<ul>
114114
<li>Unlike <a class="el" href="ATAN.html">ATAN</a>, which only returns results in <code>-π/2 … π/2</code>, <code>ATAN2</code> resolves the full circle by considering both <code>x</code> and <code>y</code> signs.</li>
@@ -125,7 +125,7 @@ <h3><a class="anchor" id="autotoc_md471"></a>
125125
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
126126
<ul>
127127
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="builtin-functions.html">Built-In Functions</a></li><li class="navelem"><a class="el" href="real-funcs.html">Real Functions</a></li>
128-
<li class="footer">Generated on Thu Sep 18 2025 00:15:35 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
128+
<li class="footer">Generated on Thu Sep 18 2025 21:16:10 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
129129
</ul>
130130
</div>
131131
</body>

docs/AUTOFLIP.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
103103
<ul>
104104
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="keywords.html">Keywords</a></li>
105-
<li class="footer">Generated on Thu Sep 18 2025 00:15:35 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
105+
<li class="footer">Generated on Thu Sep 18 2025 21:16:11 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
106106
</ul>
107107
</div>
108108
</body>

docs/BACKGROUND.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ <h5>Notes</h5>
157157
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
158158
<ul>
159159
<li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="basic-ref.html">BASIC Language Reference</a></li><li class="navelem"><a class="el" href="keywords.html">Keywords</a></li>
160-
<li class="footer">Generated on Thu Sep 18 2025 00:15:35 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
160+
<li class="footer">Generated on Thu Sep 18 2025 21:16:11 for Retro Rocket OS by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
161161
</ul>
162162
</div>
163163
</body>

0 commit comments

Comments
 (0)