mp3 replaced by ogg
+ value of radio button discared, because never used
This commit is contained in:
+2
-2
@@ -2,12 +2,12 @@
|
|||||||
import * as c from "./constants.js"
|
import * as c from "./constants.js"
|
||||||
|
|
||||||
export const soundPongArr: HTMLAudioElement[] = [];
|
export const soundPongArr: HTMLAudioElement[] = [];
|
||||||
export const soundRoblox = new Audio("http://localhost:8080/sound/roblox-oof.mp3");
|
export const soundRoblox = new Audio("http://localhost:8080/sound/roblox-oof.ogg");
|
||||||
|
|
||||||
export function initAudio(muteFlag: boolean)
|
export function initAudio(muteFlag: boolean)
|
||||||
{
|
{
|
||||||
for (let i = 0; i <= 32; i++) {
|
for (let i = 0; i <= 32; i++) {
|
||||||
soundPongArr.push(new Audio("http://localhost:8080/sound/pong/"+i+".mp3"));
|
soundPongArr.push(new Audio("http://localhost:8080/sound/pong/"+i+".ogg"));
|
||||||
soundPongArr[i].volume = c.soundPongVolume;
|
soundPongArr[i].volume = c.soundPongVolume;
|
||||||
soundPongArr[i].muted = muteFlag;
|
soundPongArr[i].muted = muteFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label>sound :</label>
|
<label>sound :</label>
|
||||||
<input type="radio" id="sound_on" name="sound_selector" value="on" checked>
|
<input type="radio" id="sound_on" name="sound_selector" checked>
|
||||||
<label for="sound_on">on</label>
|
<label for="sound_on">on</label>
|
||||||
<input type="radio" id="sound_off" name="sound_selector" value="off">
|
<input type="radio" id="sound_off" name="sound_selector">
|
||||||
<label for="sound_off">off</label>
|
<label for="sound_off">off</label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ const server = http.createServer((req, res) => {
|
|||||||
else if (path.extname(filename) === ".mp3") {
|
else if (path.extname(filename) === ".mp3") {
|
||||||
res.writeHead(200, {"Content-Type": "audio/mpeg"});
|
res.writeHead(200, {"Content-Type": "audio/mpeg"});
|
||||||
}
|
}
|
||||||
|
else if (path.extname(filename) === ".ogg") {
|
||||||
|
res.writeHead(200, {"Content-Type": "audio/ogg"});
|
||||||
|
}
|
||||||
res.write(data);
|
res.write(data);
|
||||||
return res.end();
|
return res.end();
|
||||||
});
|
});
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user