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

Unified Diff: Source/modules/webaudio/PeriodicWave.h

Issue 1180613007: Allow larger arrays up to size 8192 for PeriodicWave (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and use Audit.runTasks() Created 5 years, 5 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/AbstractAudioContext.cpp ('k') | Source/modules/webaudio/PeriodicWave.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/PeriodicWave.h
diff --git a/Source/modules/webaudio/PeriodicWave.h b/Source/modules/webaudio/PeriodicWave.h
index 51592715694364769f213c4480c990157de868cd..123905cf44959dfbed1fa08aaa541703a4702cd4 100644
--- a/Source/modules/webaudio/PeriodicWave.h
+++ b/Source/modules/webaudio/PeriodicWave.h
@@ -40,8 +40,6 @@ namespace blink {
class PeriodicWave : public GarbageCollectedFinalized<PeriodicWave>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
- // Maximum array size allowed for creating PeriodicWave's.
- static const unsigned kMaxPeriodicWaveArraySize;
static PeriodicWave* createSine(float sampleRate);
static PeriodicWave* createSquare(float sampleRate);
static PeriodicWave* createSawtooth(float sampleRate);
@@ -61,7 +59,11 @@ public:
// Returns the scalar multiplier to the oscillator frequency to calculate wave buffer phase increment.
float rateScale() const { return m_rateScale; }
- unsigned periodicWaveSize() const { return m_periodicWaveSize; }
+ // The size of the FFT to use based on the sampling rate.
+ unsigned periodicWaveSize() const;
+
+ // The number of ranges needed for the given sampling rate and FFT size.
+ unsigned numberOfRanges() const { return m_numberOfRanges; }
DEFINE_INLINE_TRACE() { }
@@ -71,7 +73,6 @@ private:
void generateBasicWaveform(int);
float m_sampleRate;
- unsigned m_periodicWaveSize;
unsigned m_numberOfRanges;
float m_centsPerRange;
« no previous file with comments | « Source/modules/webaudio/AbstractAudioContext.cpp ('k') | Source/modules/webaudio/PeriodicWave.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698