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 "media/base/channel_layout.h" | 9 #include "media/base/channel_layout.h" |
10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
32 bool operator()(const AudioParameters& a, const AudioParameters& b) const; | 32 bool operator()(const AudioParameters& a, const AudioParameters& b) const; |
33 }; | 33 }; |
34 | 34 |
35 enum Format { | 35 enum Format { |
36 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. | 36 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. |
37 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. | 37 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. |
38 AUDIO_MOCK, // Creates a dummy AudioOutputStream object. | 38 AUDIO_MOCK, // Creates a dummy AudioOutputStream object. |
39 AUDIO_LAST_FORMAT // Only used for validation of format.y | 39 AUDIO_LAST_FORMAT // Only used for validation of format.y |
40 }; | 40 }; |
41 | 41 |
42 // Telephone quality sample rate, mostly for speech-only audio. | 42 enum { |
43 static const uint32 kTelephoneSampleRate = 8000; | 43 // Telephone quality sample rate, mostly for speech-only audio. |
44 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. | 44 kTelephoneSampleRate = 8000, |
45 static const uint32 kAudioCDSampleRate = 44100; | 45 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. |
acolwell GONE FROM CHROMIUM
2012/07/31 18:09:42
nit: remove everything after the or?
Ami GONE FROM CHROMIUM
2012/07/31 18:14:43
Dunno where this came from, leaving for now.
Ami GONE FROM CHROMIUM
2012/07/31 20:23:55
FTR, this was introduced in http://codereview.chro
| |
46 // Digital Audio Tape sample rate. | 46 kAudioCDSampleRate = 44100, |
47 static const uint32 kAudioDATSampleRate = 48000; | 47 }; |
48 | 48 |
49 AudioParameters(); | 49 AudioParameters(); |
50 AudioParameters(Format format, ChannelLayout channel_layout, | 50 AudioParameters(Format format, ChannelLayout channel_layout, |
51 int sample_rate, int bits_per_sample, | 51 int sample_rate, int bits_per_sample, |
52 int frames_per_buffer); | 52 int frames_per_buffer); |
53 void Reset(Format format, ChannelLayout channel_layout, | 53 void Reset(Format format, ChannelLayout channel_layout, |
54 int sample_rate, int bits_per_sample, | 54 int sample_rate, int bits_per_sample, |
55 int frames_per_buffer); | 55 int frames_per_buffer); |
56 | 56 |
57 // Checks that all values are in the expected range. All limits are specified | 57 // Checks that all values are in the expected range. All limits are specified |
(...skipping 23 matching lines...) Expand all Loading... | |
81 int bits_per_sample_; // Number of bits per sample. | 81 int bits_per_sample_; // Number of bits per sample. |
82 int frames_per_buffer_; // Number of frames in a buffer. | 82 int frames_per_buffer_; // Number of frames in a buffer. |
83 | 83 |
84 int channels_; // Number of channels. Value set based on | 84 int channels_; // Number of channels. Value set based on |
85 // |channel_layout|. | 85 // |channel_layout|. |
86 }; | 86 }; |
87 | 87 |
88 } // namespace media | 88 } // namespace media |
89 | 89 |
90 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 90 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
OLD | NEW |