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 enum Format { | 11 enum Format { |
12 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. | 12 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. |
13 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. | 13 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. |
14 AUDIO_MOCK, // Creates a dummy AudioOutputStream object. | 14 AUDIO_MOCK, // Creates a dummy AudioOutputStream object. |
15 AUDIO_LAST_FORMAT // Only used for validation of format. | 15 AUDIO_LAST_FORMAT // Only used for validation of format. |
16 }; | 16 }; |
17 | 17 |
18 // Telephone quality sample rate, mostly for speech-only audio. | 18 // Telephone quality sample rate, mostly for speech-only audio. |
19 static const uint32 kTelephoneSampleRate = 8000; | 19 static const uint32 kTelephoneSampleRate = 8000; |
20 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. | 20 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. |
21 static const uint32 kAudioCDSampleRate = 44100; | 21 static const uint32 kAudioCDSampleRate = 44100; |
22 // Digital Audio Tape sample rate. | 22 // Digital Audio Tape sample rate. |
23 static const uint32 kAudioDATSampleRate = 48000; | 23 static const uint32 kAudioDATSampleRate = 48000; |
24 | 24 |
25 AudioParameters(); | 25 AudioParameters(); |
26 | 26 |
27 AudioParameters(Format format, int channels, | 27 AudioParameters(Format format, int channels, int sample_rate, |
28 int sample_rate, int bits_per_sample); | 28 int bits_per_sample, int samples_per_packet); |
29 | 29 |
30 bool IsValid() const; | 30 bool IsValid() const; |
31 | 31 |
32 Format format; // Format of the stream. | 32 Format format; // Format of the stream. |
33 int channels; // Number of channels. | 33 int channels; // Number of channels. |
34 int sample_rate; // Sampling frequency/rate. | 34 int sample_rate; // Sampling frequency/rate. |
35 int bits_per_sample; // Number of bits per sample. | 35 int bits_per_sample; // Number of bits per sample. |
36 int samples_per_packet; // Size of a packet in frames. | |
scherkus (not reviewing)
2010/11/09 02:28:31
nit: i'd realign these comments
Sergey Ulanov
2010/11/09 22:29:58
Done.
| |
36 }; | 37 }; |
37 | 38 |
38 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 39 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
OLD | NEW |