26 DrwavCanDecode = (1 << 0),
27 SndfileCanDecode = (1 << 1),
28 LibavCanDecode = (1 << 2),
32 int32_t audioStream{-1};
34 int32_t convertedRate{};
37 int64_t convertedLength{};
38 int64_t max_arr_length{};
39 std::optional<double> tempo;
42 TimeVal duration()
const noexcept;
52 static std::optional<AudioInfo> do_probe(
const QString& path);
53 void decode(
const QString& path,
int track, audio_handle hdl);
55 static std::optional<std::pair<AudioInfo, audio_array>>
56 decode_synchronous(
const QString& path,
int rate);
60 static std::optional<AudioInfo> find_info(
const QString& path);
61 static void store_info(
const QString& path,
const AudioInfo& info);
63 int32_t fileSampleRate{};
64 int32_t convertedSampleRate{};
70 std::atomic<std::size_t> decoded{};
73 std::size_t produced{};
76 void newData() W_SIGNAL(newData);
77 void finishedDecoding(audio_handle hdl) W_SIGNAL(finishedDecoding, hdl);
79 void startDecode(QString str, audio_handle hdl) W_SIGNAL(startDecode, str, hdl);
82 void on_startDecode(QString, audio_handle hdl);
83 W_SLOT(on_startDecode);
86 static
double read_length(const QString& path);
88 QThread* m_baseThread{};
89 QThread m_decodeThread;
91 template <
typename Decoder>
92 void decodeFrame(Decoder dec, audio_array& data, AVFrame& frame);
94 template <
typename Decoder>
95 void decodeRemaining(Decoder dec, audio_array& data, AVFrame& frame);
96 std::vector<SwrContext*> resampler;