This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17809 - Define media.preservePitch attribute
Summary: Define media.preservePitch attribute
Status: RESOLVED NEEDSINFO
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 06:52 UTC by contributor
Modified: 2012-10-29 23:49 UTC (History)
7 users (show)

See Also:


Attachments

Description contributor 2012-07-18 06:52:55 UTC
This was was cloned from bug 15318 as part of operation convergence.
Originally filed: 2011-12-23 00:02:00 +0000
Original reporter: Ralph Giles <giles@mozilla.com>

================================================================================
 #0   Ralph Giles                                     2011-12-23 00:02:22 +0000 
--------------------------------------------------------------------------------
HTML media elements have a playbackRate attribute which can be used to adjust the playback rate. For video this just involves changing the display rate for frames. For audio the situation is more complicated.

The simplest method is to resampling the audio relative to the audio device's playback rate. This results in a pitch shift: playbackRate > 1.5 or so is high and squeeky, playbackRate < 0.8 is low and echo-y. There are also more sophisticated methods which attempt to preserve the spectral character so that perceived pitches are preserved, though usually with some reduction in fidelity where music is concerned.

There are reasonable use cases for both pitch-preserving and pitch-shifting cases, and the specification currently leaves the decision to implementors.

Apple initially implemented the pitch-preserving case, but later added a 'webkitPreservesPitch' boolean attribute to control this choice.[1]

Looking at how we'd support playbackRate in Firefox, we found this a useful distinction and suggest such an attribute be added to the specification. e.g.:

interface HTMLMediaElement : HTMLElement {
    attribute boolean preservePitch;
};

The element could default to true, since this is the less objectional behaviour and is compabtible with webkitPreservesPitch.

[1] http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-July/021100.html
================================================================================
 #1   Ian 'Hixie' Hickson                             2012-02-01 00:45:06 +0000 
--------------------------------------------------------------------------------
When would you _not_ want to preserve pitch in a media player? (I understand that you might want to do a pitch change for special sound effect purposes, but that's the kind of thing I'd expect to see in Web Audio, not in media elements.)
================================================================================