| 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 | 5 |
| 6 /** | 6 /** |
| 7 * This file defines the PPB_AudioConfig interface for establishing an | 7 * This file defines the PPB_AudioConfig interface for establishing an |
| 8 * audio configuration resource within the browser. | 8 * audio configuration resource within the browser. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 label Chrome { | 11 label Chrome { |
| 12 M14 = 1.0, | 12 M14 = 1.0, |
| 13 M18 = 1.1 | 13 M19 = 1.1 |
| 14 }; | 14 }; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * This enumeration contains audio frame count constants. | 17 * This enumeration contains audio frame count constants. |
| 18 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> is the minimum possible frame | 18 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> is the minimum possible frame |
| 19 * count. <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> is the maximum possible | 19 * count. <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> is the maximum possible |
| 20 * frame count. | 20 * frame count. |
| 21 */ | 21 */ |
| 22 [unnamed] enum PP_AudioFrameSize { | 22 [unnamed] enum PP_AudioFrameSize { |
| 23 PP_AUDIOMINSAMPLEFRAMECOUNT = 64, | 23 PP_AUDIOMINSAMPLEFRAMECOUNT = 64, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 * closest to the requested count. The sample frame count determines the | 127 * closest to the requested count. The sample frame count determines the |
| 128 * overall latency of audio. Since one "frame" is always buffered in advance, | 128 * overall latency of audio. Since one "frame" is always buffered in advance, |
| 129 * smaller frame counts will yield lower latency, but higher CPU utilization. | 129 * smaller frame counts will yield lower latency, but higher CPU utilization. |
| 130 * | 130 * |
| 131 * Supported sample frame counts will vary by hardware and system (consider | 131 * Supported sample frame counts will vary by hardware and system (consider |
| 132 * that the local system might be anywhere from a cell phone or a high-end | 132 * that the local system might be anywhere from a cell phone or a high-end |
| 133 * audio workstation). Sample counts less than | 133 * audio workstation). Sample counts less than |
| 134 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than | 134 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than |
| 135 * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any | 135 * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any |
| 136 * system, but values in between aren't necessarily valid. This function | 136 * system, but values in between aren't necessarily valid. This function |
| 137 * will return a supported count closest to the requested value. | 137 * will return a supported count closest to the requested frame count. |
| 138 * | 138 * |
| 139 * RecommendSampleFrameCount() result is intended for audio output devices. | 139 * RecommendSampleFrameCount() result is intended for audio output devices. |
| 140 * | 140 * |
| 141 * @param[in] instance | 141 * @param[in] instance |
| 142 * @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either | 142 * @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either |
| 143 * <code>PP_AUDIOSAMPLERATE_44100</code> or | 143 * <code>PP_AUDIOSAMPLERATE_44100</code> or |
| 144 * <code>PP_AUDIOSAMPLERATE_48000.</code> | 144 * <code>PP_AUDIOSAMPLERATE_48000.</code> |
| 145 * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested | 145 * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested |
| 146 * frame count. | 146 * frame count. |
| 147 * | 147 * |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 * 0 if the resource is invalid. Refer to | 192 * 0 if the resource is invalid. Refer to |
| 193 * RecommendSampleFrameCount() for more on sample frame counts. | 193 * RecommendSampleFrameCount() for more on sample frame counts. |
| 194 */ | 194 */ |
| 195 uint32_t GetSampleFrameCount( | 195 uint32_t GetSampleFrameCount( |
| 196 [in] PP_Resource config); | 196 [in] PP_Resource config); |
| 197 | 197 |
| 198 /** | 198 /** |
| 199 * RecommendSampleRate() returns the native sample rate that the browser | 199 * RecommendSampleRate() returns the native sample rate that the browser |
| 200 * is using in the backend. Applications that use the recommended sample | 200 * is using in the backend. Applications that use the recommended sample |
| 201 * rate will have potentially better latency and fidelity. The return value | 201 * rate will have potentially better latency and fidelity. The return value |
| 202 * is indended for audio output devices. | 202 * is indended for audio output devices. If the output sample rate cannot be |
| 203 * determined, this function can return PP_AUDIOSAMPLERATE_NONE. |
| 203 * | 204 * |
| 204 * @param[in] instance | 205 * @param[in] instance |
| 205 * | 206 * |
| 206 * @return A <code>uint32_t</code> containing the recommended sample frame | 207 * @return A <code>uint32_t</code> containing the recommended sample frame |
| 207 * count if successful. | 208 * count if successful. |
| 208 */ | 209 */ |
| 209 [version=1.1] | 210 [version=1.1] |
| 210 PP_AudioSampleRate RecommendSampleRate( | 211 PP_AudioSampleRate RecommendSampleRate( |
| 211 [in] PP_Instance instance); | 212 [in] PP_Instance instance); |
| 212 | 213 |
| 213 }; | 214 }; |
| 214 | 215 |
| OLD | NEW |