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

Side by Side Diff: Source/platform/audio/Spatializer.h

Issue 691143007: Implement StereoPannerNode for robust stereo panning (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « Source/modules/webaudio/StereoPannerNode.idl ('k') | Source/platform/audio/Spatializer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef Spatializer_h
6 #define Spatializer_h
7
8 #include "platform/PlatformExport.h"
9 #include "platform/heap/Handle.h"
10
11 namespace blink {
12
13 class AudioBus;
14
15 // Abstract base class for spatializing a mono or stereo source.
16 class PLATFORM_EXPORT Spatializer : public GarbageCollected<Spatializer> {
17 public:
18 enum {
19 PanningModelEqualPower = 0
20
21 // We have a plan to add more panning models other than equal-power.
22 // (such as binaural-HRTF or N-channel surround panning)
23 };
24
25 typedef unsigned PanningModel;
26
27 static Spatializer* create(PanningModel, float sampleRate);
28
29 // Handle sample-accurate panning by AudioParam automation.
30 virtual void panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputBuf, const float* panValues, size_t framesToProcess) = 0;
31
32 // Handle de-zippered panning to a target value.
33 virtual void panToTargetValue(const AudioBus* inputBus, AudioBus* outputBuf, float panValue, size_t framesToProcess) = 0;
34
35 virtual void reset() = 0;
36 virtual double tailTime() const = 0;
37 virtual double latencyTime() const = 0;
38
39 virtual void trace(Visitor*) { }
40
41 protected:
42 explicit Spatializer(PanningModel model) { }
43 };
44
45 } // namespace blink
46
47 #endif // Spatializer_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/StereoPannerNode.idl ('k') | Source/platform/audio/Spatializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698