32 lines
734 B
C++
32 lines
734 B
C++
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <cstdint>
|
|
|
|
#include "behavior/events/types.hpp"
|
|
#include "../base/PacketData.hpp"
|
|
|
|
|
|
namespace drp::packet {
|
|
|
|
|
|
/**
|
|
* Represent the content of an audio packet.
|
|
* Contains a chunk of audio and its metadata to play it.
|
|
*/
|
|
class AudioPacketData : public base::PacketData<event::EventType::AUDIO, AudioPacketData> {
|
|
public:
|
|
// scheduling
|
|
// TODO(Faraphel): use a more "fixed" size format ?
|
|
std::chrono::time_point<std::chrono::high_resolution_clock> timePlay;
|
|
// audio settings
|
|
std::uint8_t channels {};
|
|
std::uint32_t sampleFormat {};
|
|
std::uint32_t sampleRate {};
|
|
// content
|
|
std::uint16_t contentSize {};
|
|
std::array<std::uint8_t, 65280> content {};
|
|
};
|
|
|
|
|
|
}
|