From fc1d270b4cbdea973c0ad04ff4470fcd2663c4f4 Mon Sep 17 00:00:00 2001 From: luigi-rosso Date: Thu, 28 Mar 2024 23:41:31 +0000 Subject: [PATCH] Export audio clip Fixes an issue with the audio preview generator using the wrong sample rate when clipping the audio which is resulting in incorrect exported audio files. Allows referencing and playing back audio clips and now generalizes the behavior as AssetFile(s). Diffs= a69bfba11 Export audio clip (#6949) Co-authored-by: Luigi Rosso --- .rive_head | 2 +- src/audio/audio_reader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rive_head b/.rive_head index 292ff7c5..34c1fdde 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -fee67f16df7648b5c9bc100b6221c7ba5baca0af +a69bfba11ec4a116b8712af0b685aa27a5309e43 diff --git a/src/audio/audio_reader.cpp b/src/audio/audio_reader.cpp index bfc3d182..8451b3ca 100644 --- a/src/audio/audio_reader.cpp +++ b/src/audio/audio_reader.cpp @@ -12,7 +12,7 @@ AudioReader::AudioReader(rcp audioSource, uint32_t channels) : AudioReader::~AudioReader() { ma_decoder_uninit(&m_decoder); } uint32_t AudioReader::channels() const { return m_channels; } -uint32_t AudioReader::sampleRate() const { return m_source->sampleRate(); } +uint32_t AudioReader::sampleRate() const { return m_decoder.outputSampleRate; } ma_decoder* AudioReader::decoder() { return &m_decoder; } uint64_t AudioReader::lengthInFrames()