diff --git a/SerialPrograms/Source/CommonFramework/AudioPipeline/IO/AudioFileLoader_Tests.cpp b/SerialPrograms/Source/CommonFramework/AudioPipeline/IO/AudioFileLoader_Tests.cpp index ba51f62b79..fa86d0f793 100644 --- a/SerialPrograms/Source/CommonFramework/AudioPipeline/IO/AudioFileLoader_Tests.cpp +++ b/SerialPrograms/Source/CommonFramework/AudioPipeline/IO/AudioFileLoader_Tests.cpp @@ -318,7 +318,7 @@ class LoadFullRateMismatchTest : public UnitTest{ virtual UnitTestResult run(Logger& logger, CancellableScope& scope) const override{ const std::vector samples = {0, 1, 0, 1}; - const std::string path = temp_wav_path("s16_44100_2ch"); + const std::string path = temp_wav_path("s16_44100_2ch_rate_mismatch"); write_wav_file(path, 1, 2, 44100, 16, to_bytes(samples)); QAudioFormat target; diff --git a/SerialPrograms/Source/CommonFramework/Recording/StreamHistorySession.cpp b/SerialPrograms/Source/CommonFramework/Recording/StreamHistorySession.cpp index 0ed1f96414..93a6e72764 100644 --- a/SerialPrograms/Source/CommonFramework/Recording/StreamHistorySession.cpp +++ b/SerialPrograms/Source/CommonFramework/Recording/StreamHistorySession.cpp @@ -65,8 +65,7 @@ StreamHistorySession::StreamHistorySession(Logger& logger) // The working-stream nominal shape is metadata only: the pair's // per-listener forwarder carries the shape actually requested, and // nothing validates this one. - : AudioFloatStreamListener(1) - , Kernels::AudioPipeline::WorkingAudioStreamListener(48000, 2) + : Kernels::AudioPipeline::WorkingAudioStreamListener(48000, 2) , m_data(CONSTRUCT_TOKEN, logger) {} void StreamHistorySession::start(AudioChannelFormat format, bool has_video){ @@ -114,13 +113,6 @@ bool StreamHistorySession::save(const std::string& filename) const{ return tracker->save(filename); } -void StreamHistorySession::on_samples(const float* samples, size_t frames){ - Data& data = *m_data; - WriteSpinLock lg(data.m_lock); - if (data.m_current){ - data.m_current->on_samples(samples, frames); - } -} void StreamHistorySession::push_samples(size_t samples, size_t stride, const float* data){ Data& state = *m_data; WriteSpinLock lg(state.m_lock); @@ -177,42 +169,35 @@ void StreamHistorySession::initialize(){ // stream shape (what the tree delivers through the working listener), // not the preset's legacy framing. (DUAL_44100 was previously // misreported as mono; MONO_96000 was previously framed as 2-sample - // frames at 48000.) "expected_samples_per_frame" keeps the legacy - // framing values for the AudioFloatStreamListener path. + // frames at 48000.) switch (data.m_audio_format){ case AudioChannelFormat::NONE: - expected_samples_per_frame = 0; data.m_active_channels = 0; data.m_active_rate = 0; data.m_current.reset(new StreamHistoryTracker(data.m_logger, data.m_window, 0, 0, data.m_has_video)); return; case AudioChannelFormat::MONO_48000: - expected_samples_per_frame = 1; data.m_active_channels = 1; data.m_active_rate = 48000; data.m_current.reset(new StreamHistoryTracker(data.m_logger, data.m_window, 1, 48000, data.m_has_video)); return; case AudioChannelFormat::DUAL_44100: - expected_samples_per_frame = 2; data.m_active_channels = 2; data.m_active_rate = 44100; data.m_current.reset(new StreamHistoryTracker(data.m_logger, data.m_window, 2, 44100, data.m_has_video)); return; case AudioChannelFormat::DUAL_48000: - expected_samples_per_frame = 2; data.m_active_channels = 2; data.m_active_rate = 48000; data.m_current.reset(new StreamHistoryTracker(data.m_logger, data.m_window, 2, 48000, data.m_has_video)); return; case AudioChannelFormat::MONO_96000: - expected_samples_per_frame = 2; data.m_active_channels = 1; data.m_active_rate = 96000; data.m_current.reset(new StreamHistoryTracker(data.m_logger, data.m_window, 1, 96000, data.m_has_video)); return; case AudioChannelFormat::INTERLEAVE_LR_96000: case AudioChannelFormat::INTERLEAVE_RL_96000: - expected_samples_per_frame = 2; data.m_active_channels = 2; data.m_active_rate = 48000; data.m_current.reset(new StreamHistoryTracker(data.m_logger, data.m_window, 2, 48000, data.m_has_video)); diff --git a/SerialPrograms/Source/CommonFramework/Recording/StreamHistorySession.h b/SerialPrograms/Source/CommonFramework/Recording/StreamHistorySession.h index dae2f2bcc8..036265815c 100644 --- a/SerialPrograms/Source/CommonFramework/Recording/StreamHistorySession.h +++ b/SerialPrograms/Source/CommonFramework/Recording/StreamHistorySession.h @@ -19,8 +19,7 @@ namespace PokemonAutomation{ class StreamHistorySession - : public AudioFloatStreamListener - , public Kernels::AudioPipeline::WorkingAudioStreamListener + : public Kernels::AudioPipeline::WorkingAudioStreamListener , public VideoFrameListener , public AudioSession::StateListener , public VideoSession::StateListener @@ -36,9 +35,6 @@ class StreamHistorySession void set_audio_session(AudioSession& session); public: - // Legacy float stream (kept until the remaining float consumers - // migrate; see the audio pipeline hand-off doc). - virtual void on_samples(const float* data, size_t frames) override; // Working stream, delivered in the shape requested at attach time // (the active preset's physical shape), split (planar) channels. virtual void push_samples(size_t samples, size_t stride, const float* data) override; diff --git a/SerialPrograms/Source/GameConsole/Framework/ConsoleSystemSession.cpp b/SerialPrograms/Source/GameConsole/Framework/ConsoleSystemSession.cpp index bc420dda97..9d6e257359 100644 --- a/SerialPrograms/Source/GameConsole/Framework/ConsoleSystemSession.cpp +++ b/SerialPrograms/Source/GameConsole/Framework/ConsoleSystemSession.cpp @@ -29,7 +29,6 @@ bool ConsoleSystemSession::try_shutdown() noexcept{ m_video.remove_state_listener(m_history); m_video.remove_state_listener(m_history); - m_audio.remove_stream_listener(m_history); m_audio.remove_working_stream_listener(m_history); m_audio.remove_state_listener(m_history); @@ -88,7 +87,6 @@ ConsoleSystemSession::ConsoleSystemSession( m_overlay.add_stat(*m_main_thread_utilization); m_audio.add_state_listener(m_history); - m_audio.add_stream_listener(m_history); m_video.add_state_listener(m_history); m_video.add_frame_listener(m_history);