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

Unified Diff: Source/modules/webaudio/OfflineAudioContext.cpp

Issue 565643003: Move utility functions for sample rate to AudioUtilities. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add modification in MediaElementSourceNode. Created 6 years, 3 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
« no previous file with comments | « Source/modules/webaudio/MediaElementAudioSourceNode.cpp ('k') | Source/platform/audio/AudioUtilities.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « Source/modules/webaudio/MediaElementAudioSourceNode.cpp ('k') | Source/platform/audio/AudioUtilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698