2 #include <Process/TimeValue.hpp>
4 #include <Media/AudioArray.hpp>
6 #include <ossia/detail/span.hpp>
14 using rms_sample_t = int16_t;
21 uint32_t sampleRate{};
22 uint32_t bufferSize{};
29 void load(QString abspath,
int channels,
int rate,
TimeVal duration);
33 void decode(
const std::vector<tcb::span<const ossia::audio_sample>>& audio);
34 void decodeLast(
const std::vector<tcb::span<const ossia::audio_sample>>& audio);
37 void decode(ossia::drwav_handle& audio);
38 double sampleRateRatio(
double expectedRate)
const noexcept;
40 ossia::small_vector<float, 8>
41 frame(int64_t start_sample, int64_t end_sample)
const noexcept;
43 int64_t frames_count = 0;
44 int64_t samples_count = 0;
46 Header* header_ptr() const noexcept {
return header; }
47 rms_sample_t* data_ptr() const noexcept {
return data; }
49 void newData() W_SIGNAL(newData);
50 void finishedDecoding() W_SIGNAL(finishedDecoding);
53 rms_sample_t computeChannelRMS(
54 tcb::span<const ossia::audio_sample> chan, int64_t start_idx, int64_t buffer_size);
56 const std::vector<tcb::span<const ossia::audio_sample>>& audio,
int buffer_size);
58 const std::vector<tcb::span<const ossia::audio_sample>>& audio,
int buffer_size);
60 computeChannelRMS(ossia::drwav_handle& wav, rms_sample_t* bytes, int64_t buffer_size);
Definition: TimeValue.hpp:21