Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 9 |
| 10 struct AudioParameters { | 10 struct AudioParameters { |
| 11 // CompareAudioParams is useful when AudioParameters is used as a | |
| 12 // key in std::map. | |
| 13 class CompareAudioParams { | |
|
scherkus (not reviewing)
2010/11/24 02:01:59
nit: considering this is declared inside AudioPara
Sergey Ulanov
2010/11/24 03:49:54
Done.
| |
| 14 public: | |
| 15 bool operator()(const AudioParameters& a, const AudioParameters& b) const; | |
| 16 }; | |
| 17 | |
| 11 enum Format { | 18 enum Format { |
| 12 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. | 19 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. |
| 13 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. | 20 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. |
| 14 AUDIO_MOCK, // Creates a dummy AudioOutputStream object. | 21 AUDIO_MOCK, // Creates a dummy AudioOutputStream object. |
| 15 AUDIO_LAST_FORMAT // Only used for validation of format. | 22 AUDIO_LAST_FORMAT // Only used for validation of format. |
| 16 }; | 23 }; |
| 17 | 24 |
| 18 // Telephone quality sample rate, mostly for speech-only audio. | 25 // Telephone quality sample rate, mostly for speech-only audio. |
| 19 static const uint32 kTelephoneSampleRate = 8000; | 26 static const uint32 kTelephoneSampleRate = 8000; |
| 20 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. | 27 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 35 int GetPacketSize() const; | 42 int GetPacketSize() const; |
| 36 | 43 |
| 37 Format format; // Format of the stream. | 44 Format format; // Format of the stream. |
| 38 int channels; // Number of channels. | 45 int channels; // Number of channels. |
| 39 int sample_rate; // Sampling frequency/rate. | 46 int sample_rate; // Sampling frequency/rate. |
| 40 int bits_per_sample; // Number of bits per sample. | 47 int bits_per_sample; // Number of bits per sample. |
| 41 int samples_per_packet; // Size of a packet in frames. | 48 int samples_per_packet; // Size of a packet in frames. |
| 42 }; | 49 }; |
| 43 | 50 |
| 44 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 51 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
| OLD | NEW |