Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: media/audio/audio_util.h

Issue 10871051: Convert WebAudio file handlers to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update webkit glue gyp. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/audio/audio_util.cc » ('j') | media/base/audio_bus.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 14 matching lines...) Expand all
107 MEDIA_EXPORT bool IsWASAPISupported(); 94 MEDIA_EXPORT bool IsWASAPISupported();
108 95
109 // Returns number of buffers to be used by wave out. 96 // Returns number of buffers to be used by wave out.
110 MEDIA_EXPORT int NumberOfWaveOutBuffers(); 97 MEDIA_EXPORT int NumberOfWaveOutBuffers();
111 98
112 #endif // defined(OS_WIN) 99 #endif // defined(OS_WIN)
113 100
114 } // namespace media 101 } // namespace media
115 102
116 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_ 103 #endif // MEDIA_AUDIO_AUDIO_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_util.cc » ('j') | media/base/audio_bus.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698