OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "media/base/channel_layout.h" | 10 #include "media/base/channel_layout.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // Telephone quality sample rate, mostly for speech-only audio. | 41 // Telephone quality sample rate, mostly for speech-only audio. |
42 kTelephoneSampleRate = 8000, | 42 kTelephoneSampleRate = 8000, |
43 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. | 43 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. |
44 kAudioCDSampleRate = 44100, | 44 kAudioCDSampleRate = 44100, |
45 }; | 45 }; |
46 | 46 |
47 // Bitmasks to determine whether certain platform (typically hardware) audio | 47 // Bitmasks to determine whether certain platform (typically hardware) audio |
48 // effects should be enabled. | 48 // effects should be enabled. |
49 enum PlatformEffectsMask { | 49 enum PlatformEffectsMask { |
50 NO_EFFECTS = 0x0, | 50 NO_EFFECTS = 0x0, |
51 ECHO_CANCELLER = 0x1 | 51 ECHO_CANCELLER = 0x1, |
| 52 DUCKING = 0x2, // Enables ducking if the OS supports it. |
52 }; | 53 }; |
53 | 54 |
54 AudioParameters(); | 55 AudioParameters(); |
55 AudioParameters(Format format, ChannelLayout channel_layout, | 56 AudioParameters(Format format, ChannelLayout channel_layout, |
56 int sample_rate, int bits_per_sample, | 57 int sample_rate, int bits_per_sample, |
57 int frames_per_buffer); | 58 int frames_per_buffer); |
58 AudioParameters(Format format, ChannelLayout channel_layout, | 59 AudioParameters(Format format, ChannelLayout channel_layout, |
59 int input_channels, | 60 int input_channels, |
60 int sample_rate, int bits_per_sample, | 61 int sample_rate, int bits_per_sample, |
61 int frames_per_buffer, int effects); | 62 int frames_per_buffer, int effects); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 if (a.sample_rate() != b.sample_rate()) | 136 if (a.sample_rate() != b.sample_rate()) |
136 return a.sample_rate() < b.sample_rate(); | 137 return a.sample_rate() < b.sample_rate(); |
137 if (a.bits_per_sample() != b.bits_per_sample()) | 138 if (a.bits_per_sample() != b.bits_per_sample()) |
138 return a.bits_per_sample() < b.bits_per_sample(); | 139 return a.bits_per_sample() < b.bits_per_sample(); |
139 return a.frames_per_buffer() < b.frames_per_buffer(); | 140 return a.frames_per_buffer() < b.frames_per_buffer(); |
140 } | 141 } |
141 | 142 |
142 } // namespace media | 143 } // namespace media |
143 | 144 |
144 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 145 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
OLD | NEW |