RPRedAudio.hpp 754 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // RPRedAudio.hpp
  3. // red_protocol
  4. //
  5. // Created by 杜家兑 on 2024/3/1.
  6. //
  7. #ifndef RPRedAudio_hpp
  8. #define RPRedAudio_hpp
  9. #include <stdio.h>
  10. #include "RPAudioProtocol.h"
  11. NS_RP_BEGIN
  12. class RedAudio final {
  13. public:
  14. static RedAudio* getInstance();
  15. void setAudioProtocol(AudioProtocol* audioProtocol);
  16. /// 播放音频接口
  17. void playAudio(const std::string& str);
  18. void playAudio(const std::string& str1, const std::string& str2);
  19. void playAudio(const std::string& str1, const std::string& str2, bool force, const std::vector<AudioParam>& audioParams);
  20. private:
  21. RedAudio() = default;
  22. ~RedAudio() = default;
  23. private:
  24. AudioProtocol* _audioProtocol = nullptr;
  25. };
  26. NS_RP_END
  27. #endif /* RPRedAudio_hpp */