In the following program, the `PortAudio.OpenDefaultStream` doesn't exist, and so I want you to handle that properly, and refactor the codebase where necessary:

```cs
// Compile with:  dotnet run
using static System.Console;
using System.Runtime.CompilerServices;
using System.Threading.Channels;
using PortAudioSharp;
using Concentus.Structs;
using Concentus.Oggfile;
using Concentus.Enums;
using PortAudioSharp;
using Concentus;

/* ────────────────────────────────────────────────────────────── *
 *  Configuration constants – tweak quality / size here only     *
 * ────────────────────────────────────────────────────────────── */
const int SampleRate = 48_000;                  // Opus sweet-spot
const int Channels = 1;                       // Mono ⇒ tiny files
const int SecondsPerFile = 10;
const int FramesPerBuffer = 960;                     // 20 ms (48 kHz)
const int TargetBitRate = 24_000;                  // ≈2.4 KB/s
var recordingsDir = Path.Combine(Environment.CurrentDirectory, "Recordings");
Directory.CreateDirectory(recordingsDir);

/* ────────────────────────────────────────────────────────────── *
 *  Global cancellation – CTRL+C stops the loop nicely            *
 * ────────────────────────────────────────────────────────────── */
using var cts = new CancellationTokenSource();
Console.CancelKeyPress += (_, e) => { e.Cancel = true; cts.Cancel(); };

/* ────────────────────────────────────────────────────────────── *
 *  Spawn producer (PortAudio)  → async channel → consumer (Opus) *
 * ────────────────────────────────────────────────────────────── */
var pcmChannel = Channel.CreateUnbounded<short[]>(new UnboundedChannelOptions
{
    SingleReader = true,
    SingleWriter = true,
    AllowSynchronousContinuations = false
});

var producerTask = Task.Run(() => AudioProducerAsync(pcmChannel.Writer, cts.Token));
var consumerTask = Task.Run(() => AudioConsumerAsync(pcmChannel.Reader, cts.Token));

await Task.WhenAll(producerTask, consumerTask);


/* =================================================================
 *  AUDIO PRODUCER  – records 10-second slabs from PortAudio
 * ================================================================= */
static async Task AudioProducerAsync(ChannelWriter<short[]> writer, CancellationToken token)
{
    PortAudio.Initialize();
    try
    {
        using var stream = PortAudio.OpenDefaultStream(
            Channels,            // in-channels
        0,                   // out-channels
            PaSampleFormat.Int16,
            SampleRate,
            FramesPerBuffer);

        stream.Start();

        const int samplesPerChunk = SampleRate * SecondsPerFile;
        var pcmBuffer = new short[samplesPerChunk];

        while (!token.IsCancellationRequested)
        {
            var offset = 0;
            while (offset < samplesPerChunk && !token.IsCancellationRequested)
            {
                var framesToRead = Math.Min(FramesPerBuffer, samplesPerChunk - offset);
                stream.Read(pcmBuffer.AsSpan(offset), framesToRead);
                offset += framesToRead;
            }

            // Ship a *copy* to keep the channel decoupled
            if (!token.IsCancellationRequested)
                await writer.WriteAsync(pcmBuffer.ToArray(), token);
        }
    }
    catch (Exception ex) when (Graceful(ex))
    { /* already logged */ }
    finally
    {
        PortAudio.Terminate();
        writer.Complete();
    }

    static bool Graceful(Exception ex)
    {
        Error.WriteLine($"[Producer] {ex.Message}");
        return true;   // swallow – triggers normal shutdown
    }
}

/* =================================================================
 *  AUDIO CONSUMER  – encodes each chunk to <date> - <v7>.opus
 * ================================================================= */
static async Task AudioConsumerAsync(ChannelReader<short[]> reader, CancellationToken token)
{
    while (await reader.WaitToReadAsync(token))
    {
        while (reader.TryRead(out var pcm))
        {
            var fileName = $"{DateTime.UtcNow:yyyy-MM-dd} - {Guid.NewGuid():N}.opus";
            var path = Path.Combine("Recordings", fileName);

            // Opus setup
            var encoder = OpusCodecFactory.CreateEncoder(SampleRate, Channels, OpusApplication.OPUS_APPLICATION_VOIP);
            encoder.Bitrate = TargetBitRate;
            await using var fs = File.Create(path, 32 * 1024, FileOptions.WriteThrough);
            var oggWriter = new OpusOggWriteStream(encoder, fs);

            oggWriter.WriteSamples(pcm, 0, pcm.Length);
            oggWriter.Finish();
            WriteLine($"✔︎ Saved {path}  ({fs.Length / 1024f:0.0} KB)");
        }
    }
}
```