sample_rates.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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
  3. // found in the LICENSE file.
  4. #ifndef MEDIA_BASE_SAMPLE_RATES_H_
  5. #define MEDIA_BASE_SAMPLE_RATES_H_
  6. #include "media/base/media_export.h"
  7. namespace media {
  8. // Enumeration used for histogramming sample rates into distinct buckets.
  9. // Logged to UMA, so never reuse a value, always add new/greater ones!
  10. enum AudioSampleRate {
  11. k8000Hz = 0,
  12. k16000Hz = 1,
  13. k32000Hz = 2,
  14. k48000Hz = 3,
  15. k96000Hz = 4,
  16. k11025Hz = 5,
  17. k22050Hz = 6,
  18. k44100Hz = 7,
  19. k88200Hz = 8,
  20. k176400Hz = 9,
  21. k192000Hz = 10,
  22. k24000Hz = 11,
  23. k384000Hz = 12,
  24. k768000Hz = 13,
  25. // Must always equal the largest value ever reported:
  26. kAudioSampleRateMax = k768000Hz,
  27. };
  28. // Helper method to convert integral values to their respective enum values,
  29. // returns false for unexpected sample rates.
  30. MEDIA_EXPORT bool ToAudioSampleRate(int sample_rate, AudioSampleRate* asr);
  31. } // namespace media
  32. #endif // MEDIA_BASE_SAMPLE_RATES_H_