soiz1 commited on
Commit
ab756de
·
1 Parent(s): 78f6137

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +13 -5
index.html CHANGED
@@ -997,12 +997,14 @@ document.addEventListener('DOMContentLoaded', function() {
997
  if (!isAudioCombined) return;
998
 
999
  const globalVolume = parseFloat(globalVolumeSlider.value);
1000
- video.volume = globalVolume;
1001
- volumeSlider.value = globalVolume;
 
 
1002
  updateVolumeIcon();
1003
  }
1004
 
1005
- // 再生速度を適用
1006
  function applyPlaybackRate() {
1007
  if (!isAudioCombined) return;
1008
 
@@ -1012,6 +1014,12 @@ document.addEventListener('DOMContentLoaded', function() {
1012
 
1013
  if (combinedAudioSource) {
1014
  combinedAudioSource.playbackRate.value = speed;
 
 
 
 
 
 
1015
  }
1016
 
1017
  speedValue.textContent = speed.toFixed(2) + 'x';
@@ -1445,16 +1453,16 @@ document.addEventListener('DOMContentLoaded', function() {
1445
  });
1446
  });
1447
 
1448
- // 全体音量スライダーのイベント
1449
  globalVolumeSlider.addEventListener('input', function() {
1450
  const value = parseFloat(this.value);
 
1451
  globalVolumeValue.textContent = value.toFixed(1);
1452
 
1453
  // スライダーの背景を更新
1454
  const percent = (value - this.min) / (this.max - this.min) * 100;
1455
  this.style.backgroundSize = `${percent}% 100%`;
1456
 
1457
- // 合成後に音量を適用
1458
  if (isAudioCombined) {
1459
  applyVolume();
1460
  }
 
997
  if (!isAudioCombined) return;
998
 
999
  const globalVolume = parseFloat(globalVolumeSlider.value);
1000
+ // 音量を0-1の範囲に制限
1001
+ const clampedVolume = Math.max(0, Math.min(1, globalVolume));
1002
+ video.volume = clampedVolume;
1003
+ volumeSlider.value = clampedVolume;
1004
  updateVolumeIcon();
1005
  }
1006
 
1007
+ // 再生速度を適用(ピッチ維持)
1008
  function applyPlaybackRate() {
1009
  if (!isAudioCombined) return;
1010
 
 
1014
 
1015
  if (combinedAudioSource) {
1016
  combinedAudioSource.playbackRate.value = speed;
1017
+ // ピッチを維持する設定
1018
+ if ('preservesPitch' in combinedAudioSource) {
1019
+ combinedAudioSource.preservesPitch = true;
1020
+ } else if ('preservePitch' in combinedAudioSource) {
1021
+ combinedAudioSource.preservePitch = true; // 古いブラウザ用
1022
+ }
1023
  }
1024
 
1025
  speedValue.textContent = speed.toFixed(2) + 'x';
 
1453
  });
1454
  });
1455
 
 
1456
  globalVolumeSlider.addEventListener('input', function() {
1457
  const value = parseFloat(this.value);
1458
+ // 表示値は0-10の範囲で表示
1459
  globalVolumeValue.textContent = value.toFixed(1);
1460
 
1461
  // スライダーの背景を更新
1462
  const percent = (value - this.min) / (this.max - this.min) * 100;
1463
  this.style.backgroundSize = `${percent}% 100%`;
1464
 
1465
+ // 合成後に音量を適用(0-1の範囲に変換)
1466
  if (isAudioCombined) {
1467
  applyVolume();
1468
  }