sink.h 817 B

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