OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Native Client 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 | |
5 #ifndef AUDIO_SOURCE_H_ | |
6 #define AUDIO_SOURCE_H_ | |
7 | |
8 #include "experimental/conways_life/web_resource_loader.h" | |
9 | |
10 namespace pp { | |
11 class Audio; | |
12 class Instance; | |
13 } | |
14 | |
15 namespace audio { | |
16 | |
17 // AudioSource declares the interface for a class that can be assigned to an | |
18 // AudioPlayer instance. | |
19 class AudioSource { | |
20 public: | |
21 AudioSource() {} | |
22 virtual ~AudioSource() = 0; | |
23 | |
24 // Return whether the audio source is ready to play. | |
25 virtual bool IsReady() const = 0; | |
26 | |
27 // Get the audio data. | |
28 virtual int32_t GetSampleRate() const = 0; | |
29 virtual const char* GetAudioData() const = 0; | |
30 virtual size_t GetAudioDataSize() const = 0; | |
31 }; | |
32 | |
33 inline AudioSource::~AudioSource() {} | |
34 | |
35 } // namespace audio | |
36 | |
37 #endif // AUDIO_SOURCE_H_ | |
OLD | NEW |