Spaces:
Running
Running
Update index.html
Browse files- index.html +10 -11
index.html
CHANGED
@@ -51,8 +51,8 @@
|
|
51 |
|
52 |
<div class="control-group">
|
53 |
<label for="volumeRange">音量:</label>
|
54 |
-
<input type="range" id="volumeRange" min="0" max="
|
55 |
-
<input type="number" id="volumeInput" min="0" max="
|
56 |
</div>
|
57 |
|
58 |
<div class="control-group">
|
@@ -71,11 +71,11 @@
|
|
71 |
const volumeInput = document.getElementById('volumeInput');
|
72 |
const loopCheckbox = document.getElementById('loopCheckbox');
|
73 |
|
74 |
-
// Web Audio API
|
75 |
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
76 |
const gainNode = audioContext.createGain();
|
77 |
-
const
|
78 |
-
|
79 |
gainNode.connect(audioContext.destination);
|
80 |
|
81 |
function updatePlaybackRate(value) {
|
@@ -86,13 +86,12 @@
|
|
86 |
}
|
87 |
|
88 |
function updateVolume(value) {
|
89 |
-
const volume = parseFloat(value);
|
90 |
-
volumeInput.value =
|
91 |
-
volumeRange.value =
|
92 |
|
93 |
-
//
|
94 |
-
|
95 |
-
gainNode.gain.value = Math.min(volumeLevel, 3); // 最大音量3.0に制限
|
96 |
}
|
97 |
|
98 |
['input', 'change', 'mouseup'].forEach(eventName => {
|
|
|
51 |
|
52 |
<div class="control-group">
|
53 |
<label for="volumeRange">音量:</label>
|
54 |
+
<input type="range" id="volumeRange" min="0" max="300" step="1" value="100">
|
55 |
+
<input type="number" id="volumeInput" min="0" max="300" step="1" value="100">%
|
56 |
</div>
|
57 |
|
58 |
<div class="control-group">
|
|
|
71 |
const volumeInput = document.getElementById('volumeInput');
|
72 |
const loopCheckbox = document.getElementById('loopCheckbox');
|
73 |
|
74 |
+
// Web Audio APIのセットアップ
|
75 |
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
76 |
const gainNode = audioContext.createGain();
|
77 |
+
const videoSource = audioContext.createMediaElementSource(video);
|
78 |
+
videoSource.connect(gainNode);
|
79 |
gainNode.connect(audioContext.destination);
|
80 |
|
81 |
function updatePlaybackRate(value) {
|
|
|
86 |
}
|
87 |
|
88 |
function updateVolume(value) {
|
89 |
+
const volume = parseFloat(value) / 100;
|
90 |
+
volumeInput.value = value;
|
91 |
+
volumeRange.value = value;
|
92 |
|
93 |
+
// 音量は最大3倍まで設定
|
94 |
+
gainNode.gain.value = Math.min(volume * 3, 3); // 音量を3倍までに制限
|
|
|
95 |
}
|
96 |
|
97 |
['input', 'change', 'mouseup'].forEach(eventName => {
|