38AudioFile::onBufferFinish()
40 if (
buffer_->sample_rate == 0) {
41 JAMI_ERR(
"Error unable to update playback slider, sampling rate is 0");
46 if ((updatePlaybackScale_ % 5) == 0)
51 updatePlaybackScale_++;
57 , updatePlaybackScale_(0)
59 std::list<std::shared_ptr<AudioFrame>>
buf;
60 size_t total_samples = 0;
62 auto start = std::chrono::steady_clock::now();
64 auto decoder = std::make_unique<MediaDecoder>(
65 [&r,
this, &
buf, &total_samples](
const std::shared_ptr<MediaFrame>&
frame)
mutable {
67 total_samples +=
resampled->getFrameSize();
83 buffer_->nb_samples = total_samples;
94 auto end = std::chrono::steady_clock::now();
96 JAMI_LOG(
"AudioFile: loaded {} samples ({}) as {} in {} from {:s}",
std::string filepath_
The absolute path to the sound file.
AudioFile(const std::string &filepath, unsigned int sampleRate, AVSampleFormat sampleFormat)
size_t pos_
current position, set to 0, when initialize
libjami::FrameBuffer buffer_
The data buffer.
Wrapper class for libswresample.
#define JAMI_LOG(formatstr,...)
void emitSignal(Args... args)
DeviceParams Parameters used by MediaDecoder and MediaEncoder to open a LibAV device/stream.