12#ifndef ROC_AUDIO_SAMPLE_SPEC_H_
13#define ROC_AUDIO_SAMPLE_SPEC_H_
Sample stream specification. Defines sample rate and channel layout.
size_t ns_2_samples_overall(core::nanoseconds_t ns_duration) const
Convert nanoseconds duration to number of samples for all channels.
packet::timestamp_diff_t ns_2_rtp_timestamp(core::nanoseconds_t ns_delta) const
Convert nanoseconds delta to RTP timestamp delta.
bool operator==(const SampleSpec &other) const
Check two specifications for equality.
SampleSpec(size_t sample_rate, packet::channel_mask_t channel_mask)
Constructor with sample rate and channel mask.
size_t num_channels() const
Get number of channels.
SampleSpec()
Default constructor.
packet::channel_mask_t channel_mask() const
Get channel mask.
size_t sample_rate() const
Get sample rate.
bool operator!=(const SampleSpec &other) const
Check two specifications for equality.
void set_sample_rate(size_t sample_rate)
Set sample rate.
core::nanoseconds_t samples_overall_2_ns(size_t n_samples) const
Convert number of samples for all channels to nanoseconds duration.
core::nanoseconds_t samples_per_chan_2_ns(size_t n_samples) const
Convert number of samples per channel to nanoseconds duration.
size_t ns_2_samples_per_chan(core::nanoseconds_t ns_duration) const
Convert nanoseconds duration to number of samples per channel.
core::nanoseconds_t rtp_timestamp_2_ns(packet::timestamp_diff_t rtp_delta) const
Convert RTP timestamp delta to nanoseconds delta.
void set_channel_mask(packet::channel_mask_t channel_mask)
Set channel mask.
int64_t nanoseconds_t
Nanoseconds.
uint32_t channel_mask_t
Bitmask of channels present in audio packet.
int32_t timestamp_diff_t
Audio packet timestamps difference.
Various units used in packets.