| 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_UTIL_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_UTIL_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_UTIL_H_ | 6 #define MEDIA_AUDIO_AUDIO_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // since clamping is performed a value of more than 1 is allowed to increase | 60 // since clamping is performed a value of more than 1 is allowed to increase |
| 61 // volume. | 61 // volume. |
| 62 // The buffer is modified in-place to avoid memory management, as this | 62 // The buffer is modified in-place to avoid memory management, as this |
| 63 // function may be called in performance critical code. | 63 // function may be called in performance critical code. |
| 64 MEDIA_EXPORT bool FoldChannels(void* buf, | 64 MEDIA_EXPORT bool FoldChannels(void* buf, |
| 65 size_t buflen, | 65 size_t buflen, |
| 66 int channels, | 66 int channels, |
| 67 int bytes_per_sample, | 67 int bytes_per_sample, |
| 68 float volume); | 68 float volume); |
| 69 | 69 |
| 70 // DeinterleaveAudioChannel() takes interleaved audio buffer |source| | |
| 71 // of the given |sample_fmt| and |number_of_channels| and extracts | |
| 72 // |number_of_frames| data for the given |channel_index| and | |
| 73 // puts it in the floating point |destination|. | |
| 74 // It returns |true| on success, or |false| if the |sample_fmt| is | |
| 75 // not recognized. | |
| 76 MEDIA_EXPORT bool DeinterleaveAudioChannel(void* source, | |
| 77 float* destination, | |
| 78 int channels, | |
| 79 int channel_index, | |
| 80 int bytes_per_sample, | |
| 81 size_t number_of_frames); | |
| 82 | |
| 83 // Returns the default audio output hardware sample-rate. | 70 // Returns the default audio output hardware sample-rate. |
| 84 MEDIA_EXPORT int GetAudioHardwareSampleRate(); | 71 MEDIA_EXPORT int GetAudioHardwareSampleRate(); |
| 85 | 72 |
| 86 // Returns the audio input hardware sample-rate for the specified device. | 73 // Returns the audio input hardware sample-rate for the specified device. |
| 87 MEDIA_EXPORT int GetAudioInputHardwareSampleRate( | 74 MEDIA_EXPORT int GetAudioInputHardwareSampleRate( |
| 88 const std::string& device_id); | 75 const std::string& device_id); |
| 89 | 76 |
| 90 // Returns the optimal low-latency buffer size for the audio hardware. | 77 // Returns the optimal low-latency buffer size for the audio hardware. |
| 91 // This is the smallest buffer size the system can comfortably render | 78 // This is the smallest buffer size the system can comfortably render |
| 92 // at without glitches. The buffer size is in sample-frames. | 79 // at without glitches. The buffer size is in sample-frames. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 122 MEDIA_EXPORT bool IsWASAPISupported(); | 109 MEDIA_EXPORT bool IsWASAPISupported(); |
| 123 | 110 |
| 124 // Returns number of buffers to be used by wave out. | 111 // Returns number of buffers to be used by wave out. |
| 125 MEDIA_EXPORT int NumberOfWaveOutBuffers(); | 112 MEDIA_EXPORT int NumberOfWaveOutBuffers(); |
| 126 | 113 |
| 127 #endif // defined(OS_WIN) | 114 #endif // defined(OS_WIN) |
| 128 | 115 |
| 129 } // namespace media | 116 } // namespace media |
| 130 | 117 |
| 131 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ | 118 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ |
| OLD | NEW |