| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium 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 COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_H_ | |
| 6 #define COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "media/audio/audio_io.h" | |
| 12 #include "media/base/audio_converter.h" | |
| 13 #include "media/base/audio_parameters.h" | |
| 14 | |
| 15 namespace audio_modem { | |
| 16 | |
| 17 // The AudioRecorder class will record audio until told to stop. | |
| 18 class AudioRecorder { | |
| 19 public: | |
| 20 using RecordedSamplesCallback = base::Callback<void(const std::string&)>; | |
| 21 | |
| 22 // Initializes the object. Do not use this object before calling this method. | |
| 23 virtual void Initialize(const RecordedSamplesCallback& decode_callback) = 0; | |
| 24 | |
| 25 // If we are already recording, this function will do nothing. | |
| 26 virtual void Record() = 0; | |
| 27 // If we are already stopped, this function will do nothing. | |
| 28 virtual void Stop() = 0; | |
| 29 | |
| 30 // Cleans up and deletes this object. Do not use object after this call. | |
| 31 virtual void Finalize() = 0; | |
| 32 | |
| 33 protected: | |
| 34 virtual ~AudioRecorder() {} | |
| 35 }; | |
| 36 | |
| 37 } // namespace audio_modem | |
| 38 | |
| 39 #endif // COMPONENTS_AUDIO_MODEM_AUDIO_RECORDER_H_ | |
| OLD | NEW |