Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp

Issue 1803153002: Add min/max values for AudioParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp
index 8636b518f061a1cc7f443949e779d1e406b26e5c..3dc83b36be3147145fb06f1a7a1a3e493f88b061 100644
--- a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp
@@ -333,7 +333,7 @@ bool OscillatorHandler::propagatesSilence() const
OscillatorNode::OscillatorNode(AbstractAudioContext& context, float sampleRate)
: AudioScheduledSourceNode(context)
// Use musical pitch standard A440 as a default.
- , m_frequency(AudioParam::create(context, ParamTypeOscillatorFrequency, 440))
+ , m_frequency(AudioParam::create(context, ParamTypeOscillatorFrequency, 440, 0, sampleRate / 2))
// Default to no detuning.
, m_detune(AudioParam::create(context, ParamTypeOscillatorDetune, 0))
{

Powered by Google App Engine
This is Rietveld 408576698