Một thuật toán phổ biến dựa trên FFT (Fast Fourier Transform) giúp xử lý âm thanh mượt mà. Đoạn mã ví dụ cơ bản với Tone.js: javascript
: Tiện ích miễn phí giúp điều chỉnh cao độ với độ chính xác theo từng nửa cung (semitone) mà vẫn giữ nguyên chất lượng âm thanh.
<div class="pitch-control"> <div class="slider-header"> <span class="pitch-label">✨ Pitch Shift (semitones)</span> <span class="pitch-value" id="pitchValueDisplay">0.0 st</span> </div> <input type="range" id="pitchSlider" min="-12" max="12" step="0.1" value="0"> <div class="semitone-marks"> <span>-1 oct</span><span>-6</span><span>0</span><span>+6</span><span>+1 oct</span> </div> <div style="font-size: 0.75rem; margin-top: 8px; text-align: center; color: #96abda;">⬅️ Giảm (trầm) | Tăng (thanh) ➡️</div> </div>
// Variables let audioContext; let sourceNode; let soundtouchNode; let audioBuffer; let isPlaying = false;
/* pitch slider area */ .pitch-control background: rgba(0, 0, 0, 0.35); border-radius: 2rem; padding: 1.2rem 1.5rem; margin-bottom: 1.8rem; border: 1px solid #2A3655;
Công cụ mạnh mẽ cho nhạc sĩ, hỗ trợ cả thay đổi cao độ, tốc độ và lặp đoạn (looper) tại Transpose.video .



Try for Free
Try for Free