sink.h 798 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <memory>
  5. #include <string>
  6. #include "audio_core/sink_stream.h"
  7. #include "common/common_types.h"
  8. namespace AudioCore {
  9. constexpr char auto_device_name[] = "auto";
  10. /**
  11. * This class is an interface for an audio sink. An audio sink accepts samples in stereo signed
  12. * PCM16 format to be output. Sinks *do not* handle resampling and expect the correct sample rate.
  13. * They are dumb outputs.
  14. */
  15. class Sink {
  16. public:
  17. virtual ~Sink() = default;
  18. virtual SinkStream& AcquireSinkStream(u32 sample_rate, u32 num_channels,
  19. const std::string& name) = 0;
  20. };
  21. using SinkPtr = std::unique_ptr<Sink>;
  22. } // namespace AudioCore