Web Audio detune Changes Sound Length? Check the Combined Rate
Convert cents into a rate multiplier and compare fixed playbackRate and detune settings before assuming pitch changes preserve duration.


Changing detune alters the pitch, but the sound also finishes sooner. Confirm that playback uses an AudioBufferSourceNode and log playbackRate, detune and loop state. A duration-preserving pitch feature in another audio component does not establish the behavior of this node.
Convert cents into a multiplier
The official reference describes detune in cents, with positive and negative 1200 cents corresponding to an octave up or down. The Web Audio specification defines the combined rate as playbackRate × 2^(detune / 1200). Here detune participates in playback speed. It is not a separate duration-preserving pitch processor.
Compare four constant settings
Reuse one decoded buffer with a fresh source node for each play. Disable looping and parameter automation. Compare (playbackRate=1, detune=0), (1,1200), (1,-1200) and (0.5,1200). Their calculated combined rates are 1, 2, 0.5 and 1. For full playback without an earlier stop, divide source duration by that rate to estimate output duration. These are parameter calculations, not browser measurements claimed by this article.
Keep source slicing separate
Record the start offset, source-content duration and audible duration independently. For a slice, the related diagnostic guide covers the source-time units of offset and duration. Automation or additional processors require measurements along the actual timeline rather than one constant-rate calculation. Use the SFX Generator to obtain candidate game sounds and confirm content, pitch and duration in the receiving player.
Recommended tools

AI Game SFX Generator: A Practical Guide for Indie Game Developers
Learn how an AI game SFX generator helps indie developers create fast, usable sound effects for UI, coins, weapons, magic, horror, retro games, and rapid prototypes.

AI SFX Generator vs Sound Library: Which Is Better for Game Audio?
Compare AI SFX generators and traditional sound libraries for indie game audio. Learn when to generate custom effects, when to use libraries, and how to combine both workflows.

Best Sound Effects to Create First for an Indie Game Prototype
A practical checklist of the most important game sound effects indie developers should create first, including UI clicks, pickups, hits, rewards, errors, transitions, and completion cues.
Ready to try "Web Audio detune Changes Sound Length? Check the Combined Rate"?
Use our online tools to apply this tutorial to your indie game project right away.
