#ifndef TGCALLS_AUDIO_STREAMING_PART_H #define TGCALLS_AUDIO_STREAMING_PART_H #include "absl/types/optional.h" #include #include #include #include #include "AudioStreamingPartPersistentDecoder.h" namespace tgcalls { class AudioStreamingPartState; class AudioStreamingPart { public: struct StreamingPartChannel { uint32_t ssrc = 0; std::vector pcmData; int numSamples = 0; }; explicit AudioStreamingPart(std::vector &&data, std::string const &container, bool isSingleChannel); ~AudioStreamingPart(); AudioStreamingPart(const AudioStreamingPart&) = delete; AudioStreamingPart(AudioStreamingPart&& other) { _state = other._state; other._state = nullptr; } AudioStreamingPart& operator=(const AudioStreamingPart&) = delete; AudioStreamingPart& operator=(AudioStreamingPart&&) = delete; std::map getEndpointMapping() const; int getRemainingMilliseconds() const; std::vector get10msPerChannel(AudioStreamingPartPersistentDecoder &persistentDecoder); private: AudioStreamingPartState *_state = nullptr; }; } #endif