28 lines
1.1 KiB
C#
28 lines
1.1 KiB
C#
namespace ytLive.Services.Audio;
|
|
|
|
/// <summary>
|
|
/// A live audio capture source (TASK 4 ship step 4 seam): produces PCM float
|
|
/// chunks. The default implementations wrap NAudio's WASAPI capture (mic) /
|
|
/// loopback (desktop/game); the mixer and the tests consume this interface,
|
|
/// never NAudio directly. Capture now runs for the app's lifetime so the
|
|
/// footer meters stay live in preview — the mixer owns start/stop.
|
|
/// </summary>
|
|
public interface IAudioSource : IDisposable
|
|
{
|
|
/// <summary>Starts capturing. Safe to call only once per Stop.</summary>
|
|
void Start();
|
|
|
|
/// <summary>Stops capturing; a later Start begins a fresh session.</summary>
|
|
void Stop();
|
|
|
|
/// <summary>Raises once capture is live (right after recording starts).
|
|
/// Never raised when Start fails — <see cref="Failed"/> fires instead.</summary>
|
|
event Action? Started;
|
|
|
|
/// <summary>Raises each captured chunk (interleaved PCM float, -1..1).</summary>
|
|
event Action<AudioSample>? SampleReady;
|
|
|
|
/// <summary>Raises when capture dies or fails to start (e.g. no device).</summary>
|
|
event Action<Exception>? Failed;
|
|
}
|