]> git.taranathan.com Git - audio-stream.git/commitdiff
root
authorTaran Nathan <moogoesmeow123@gmail.com>
Mon, 20 Jul 2026 23:51:52 +0000 (16:51 -0700)
committerTaran Nathan <moogoesmeow123@gmail.com>
Mon, 20 Jul 2026 23:52:54 +0000 (16:52 -0700)
favicon.png [new file with mode: 0644]
index.html [new file with mode: 0644]
script.js [new file with mode: 0644]
styles.css [new file with mode: 0644]

diff --git a/favicon.png b/favicon.png
new file mode 100644 (file)
index 0000000..5ea715c
Binary files /dev/null and b/favicon.png differ
diff --git a/index.html b/index.html
new file mode 100644 (file)
index 0000000..eafb03c
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>Recorder</title>
+  <script src="./script.js" defer></script>
+  <link rel="stylesheet" href="./styles.css">
+  <link rel="icon" type="image/x-icon" href="/favicon.png">
+</head>
+
+<body>
+  <img src="/favicon.png" style="width:20%;">
+  <header>
+    <h1>Record and Play Audio in JavaScript</h1>
+  </header>
+  <p>
+    <button id="btnStart">START RECORDING</button>
+    <button id="btnStop" disabled>STOP RECORDING</button>
+    <button id="btnPlay" disabled>PLAY RECORDING</button>
+  </p>
+  <audio id="audioPlay"></audio>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/script.js b/script.js
new file mode 100644 (file)
index 0000000..2a8c914
--- /dev/null
+++ b/script.js
@@ -0,0 +1,10 @@
+console.log("wassup")
+// Access the permission for use
+// the microphone
+navigator.mediaDevices.getUserMedia({ audio: true })
+  .then(function(audio_stream) {
+    console.log("hi");
+  })
+  .catch(function(err) {
+    console.log(err.name, err.message);
+  });
diff --git a/styles.css b/styles.css
new file mode 100644 (file)
index 0000000..f30a1dd
--- /dev/null
@@ -0,0 +1,3 @@
+* {
+  color: red;
+}
\ No newline at end of file