diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 23:56:56 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 23:56:56 +0000 |
commit | 7cecfb2fa8bd8bb4254f8d83ad0ce5d23961f98c (patch) | |
tree | 5240f4628db2efff362da4c52c69b8cb29853db6 /media/audio/audio_output.h | |
parent | b62d1a8c6795a9feefe4a2e688463c56ce46a6bd (diff) | |
download | chromium_src-7cecfb2fa8bd8bb4254f8d83ad0ce5d23961f98c.zip chromium_src-7cecfb2fa8bd8bb4254f8d83ad0ce5d23961f98c.tar.gz chromium_src-7cecfb2fa8bd8bb4254f8d83ad0ce5d23961f98c.tar.bz2 |
Low level windows audio support (part 1 of 2)
- Windows specific changes to AudioManager Allows testing for mock streams
This this the first part of the code that adds support for audio using waveXXX API.
Since is relatively lot of code I will do two CLs, unfortunately the complexity
is not evenly split.
Review URL: http://codereview.chromium.org/17401
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7987 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_output.h')
-rw-r--r-- | media/audio/audio_output.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/media/audio/audio_output.h b/media/audio/audio_output.h index da787ea..37235a2 100644 --- a/media/audio/audio_output.h +++ b/media/audio/audio_output.h @@ -33,6 +33,7 @@ // Specifically for this case we avoid supporting complex formats such as MP3 // or WMA. Complex format decoding should be done by the renderers. + // Models an audio stream that gets rendered to the audio hardware output. // Because we support more audio streams than physically available channels // a given AudioOutputStream might or might not talk directly to hardware. @@ -106,6 +107,13 @@ class AudioManager { AUDIO_MOCK // Creates a dummy AudioOutputStream object. }; + // Telephone quality sample rate, mostly for speech-only audio. + static const int kTelephoneSampleRate = 8000; + // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. + static const int kAudioCDSampleRate = 44100; + // Digital Audio Tape sample rate. + static const int kAudioDATSampleRate = 48000; + // Factory for all the supported stream formats. At this moment |channels| // can be 1 (mono) or 2 (stereo). The |sample_rate| is in hertz and can be // any value supported by the underlying platform. For some future formats @@ -123,13 +131,19 @@ class AudioManager { virtual void MuteAll() = 0; virtual void UnMuteAll() = 0; + // For testing purposes only. Returns the internal buffer of the last + // AUDIO_MOCK AudioOutputStream closed. Returns NULL if none closed yet. + // The buffer size is the same as passed to AudioOutputStream::Open(). + virtual const void* GetLastMockBuffer() = 0; + + // Get AudioManager singleton. + // TODO(cpu): Define threading requirements for interacting with AudioManager. + static AudioManager* GetAudioManager(); + protected: virtual ~AudioManager() {} }; -// Get AudioManager singleton. -// TODO(cpu): Define threading requirements for interacting with AudioManager. -AudioManager* GetAudioManager(); #endif // MEDIA_AUDIO_AUDIO_OUTPUT_H_ |