From c6f66b8227e2e3d08109ecb218dee6e7b74f6c4a Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Mon, 5 May 2025 09:54:49 -0500 Subject: [PATCH] minor change --- tests/BotSharp.Test.RealtimeVoice/Audio/AudioOut.cs | 4 +++- .../Session/ConsoleChatSession.CustomStream.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/BotSharp.Test.RealtimeVoice/Audio/AudioOut.cs b/tests/BotSharp.Test.RealtimeVoice/Audio/AudioOut.cs index ea5d71ad..97f1cbbf 100644 --- a/tests/BotSharp.Test.RealtimeVoice/Audio/AudioOut.cs +++ b/tests/BotSharp.Test.RealtimeVoice/Audio/AudioOut.cs @@ -12,7 +12,7 @@ internal class AudioOut : IDisposable private readonly BufferedWaveProvider _waveProvider; private readonly WaveOutEvent _waveOutEvent; - public AudioOut() + private AudioOut() { var audioFormat = new WaveFormat( rate: SAMPLE_RATE, @@ -33,6 +33,8 @@ internal class AudioOut : IDisposable _waveOutEvent.Play(); } + public static AudioOut Init() => new(); + public void Enqueue(BinaryData data) { var buffer = data?.ToArray() ?? []; diff --git a/tests/BotSharp.Test.RealtimeVoice/Session/ConsoleChatSession.CustomStream.cs b/tests/BotSharp.Test.RealtimeVoice/Session/ConsoleChatSession.CustomStream.cs index 4d05f47f..23949d32 100644 --- a/tests/BotSharp.Test.RealtimeVoice/Session/ConsoleChatSession.CustomStream.cs +++ b/tests/BotSharp.Test.RealtimeVoice/Session/ConsoleChatSession.CustomStream.cs @@ -14,7 +14,7 @@ internal partial class ConsoleChatSession DisplayRemarks(); var (hub, conversationId) = await Setup(agentId); - var audioOut = new AudioOut(); + var audioOut = AudioOut.Init(); await hub.ConnectToModel( responseToUser: async data =>