ggirishg commited on
Commit
d33e313
·
verified ·
1 Parent(s): 6369d28

Delete index.html

Browse files
Files changed (1) hide show
  1. index.html +0 -133
index.html DELETED
@@ -1,133 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Audio Recorder</title>
7
- <style>
8
- body {
9
- font-family: Arial, sans-serif;
10
- background-color: #ffffff;
11
- margin: 0;
12
- padding: 0;
13
- display: flex;
14
- justify-content: center;
15
- align-items: center;
16
- height: 100vh;
17
- }
18
-
19
- .container {
20
- text-align: center;
21
- background-color: #ffffff;
22
- border-radius: 0%;
23
- }
24
-
25
- h1 {
26
- color: #000000;
27
- }
28
-
29
- button {
30
- background-color: #40826D;
31
- color: rgb(0, 0, 0);
32
- border: none;
33
- padding: 10px 20px;
34
- text-align: center;
35
- text-decoration: none;
36
- display: inline-block;
37
- font-size: 16px;
38
- margin: 10px;
39
- cursor: pointer;
40
- border-radius: 5px;
41
- }
42
-
43
- button:hover {
44
- background-color: #40826D;
45
- }
46
-
47
- button:disabled {
48
- background-color: #df5e5e;
49
- cursor: not-allowed;
50
- }
51
-
52
- #timer {
53
- font-size: 20px;
54
- margin-top: 20px;
55
- color: #000000;
56
- }
57
- </style>
58
- </head>
59
- <body>
60
- <div class="container">
61
- <h1>Audio Recorder</h1>
62
- <button id="startRecording">Start Recording</button>
63
- <button id="stopRecording" disabled>Stop Recording</button>
64
- <div id="timer">00:00</div>
65
- </div>
66
-
67
- <script>
68
- let recorder;
69
- let audioChunks = [];
70
- let startTime;
71
- let timerInterval;
72
-
73
- function updateTime() {
74
- const elapsedTime = Math.floor((Date.now() - startTime) / 1000);
75
- const minutes = Math.floor(elapsedTime / 60);
76
- const seconds = elapsedTime % 60;
77
- const formattedTime = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
78
- document.getElementById('timer').textContent = formattedTime;
79
- }
80
-
81
- navigator.mediaDevices.getUserMedia({ audio: true })
82
- .then(stream => {
83
- recorder = new MediaRecorder(stream);
84
-
85
- recorder.ondataavailable = e => {
86
- audioChunks.push(e.data);
87
- };
88
-
89
- recorder.onstart = () => {
90
- startTime = Date.now();
91
- timerInterval = setInterval(updateTime, 1000);
92
- };
93
-
94
- recorder.onstop = () => {
95
- const audioBlob = new Blob(audioChunks, { type: 'audio/wav' });
96
- const audioUrl = URL.createObjectURL(audioBlob);
97
- const a = document.createElement('a');
98
- a.href = audioUrl;
99
- a.download = 'recorded_audio.wav';
100
- document.body.appendChild(a);
101
- a.click();
102
-
103
- // Reset
104
- audioChunks = [];
105
- clearInterval(timerInterval);
106
- };
107
- })
108
- .catch(err => {
109
- console.error('Permission to access microphone denied:', err);
110
- });
111
-
112
- document.getElementById('startRecording').addEventListener('click', () => {
113
- recorder.start();
114
- document.getElementById('startRecording').disabled = true;
115
- document.getElementById('stopRecording').disabled = false;
116
- setTimeout(() => {
117
- recorder.stop();
118
- document.getElementById('startRecording').disabled = false;
119
- document.getElementById('stopRecording').disabled = true;
120
- }, 15000); // 15 seconds
121
- });
122
-
123
- document.getElementById('stopRecording').addEventListener('click', () => {
124
- recorder.stop();
125
- document.getElementById('startRecording').disabled = false;
126
- document.getElementById('stopRecording').disabled = true;
127
- });
128
- </script>
129
- </body>
130
- </html>
131
- <!--
132
- (tf) C:\Users\giris>ffmpeg -i C:\Users\giris\Downloads\recorded_audio.wav -acodec pcm_s16le -ar 16000 -ac 1 C:\Users\giris\Downloads\recorded_audio2.wav
133
- -->