Index: Source/modules/webaudio/OfflineAudioContext.cpp |
diff --git a/Source/modules/webaudio/OfflineAudioContext.cpp b/Source/modules/webaudio/OfflineAudioContext.cpp |
index 8005392a8a7e992abad98516ec8253aa45ac0f82..d24ae2afa3bc44823ba5e9c3349fa364392745d0 100644 |
--- a/Source/modules/webaudio/OfflineAudioContext.cpp |
+++ b/Source/modules/webaudio/OfflineAudioContext.cpp |
@@ -33,6 +33,7 @@ |
#include "core/dom/Document.h" |
#include "core/dom/ExceptionCode.h" |
#include "core/dom/ExecutionContext.h" |
+#include "platform/audio/AudioUtilities.h" |
namespace blink { |
@@ -66,9 +67,13 @@ OfflineAudioContext* OfflineAudioContext::create(ExecutionContext* context, unsi |
return 0; |
} |
- if (!isSampleRateRangeGood(sampleRate)) { |
- exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexOutsideRange( |
- "sampleRate", sampleRate, 3000.f, ExceptionMessages::InclusiveBound, 192000.f, ExceptionMessages::InclusiveBound)); |
+ if (!AudioUtilities::isValidAudioBufferSampleRate(sampleRate)) { |
+ exceptionState.throwDOMException( |
+ IndexSizeError, |
+ ExceptionMessages::indexOutsideRange( |
+ "sampleRate", sampleRate, |
+ AudioUtilities::minAudioBufferSampleRate(), ExceptionMessages::InclusiveBound, |
+ AudioUtilities::maxAudioBufferSampleRate(), ExceptionMessages::InclusiveBound)); |
return nullptr; |
} |