Stream wav file in client-side JS and backend C#

I want to stream a wav file in JS with backend C# in a buffer so it can be instantly played instead of it downloading the whole file first. The following code stream the file but downloads it first and then it starts playing.

This snippet sends the blob from C# backend to client-side. Only it downloads the whole file first and then it plays it. And I want it to play instantly.

fetch('/api/streamSong', options)
    .then(response => response.blob())
    .then(blob => {
        const url = URL.createObjectURL(blob);
        audioElement.src = url;
        audioElement.play();
using (var blobStream = await blobClient.OpenReadAsync())
{
    context.Response.ContentType = "audio/wav";
    await blobStream.CopyToAsync(context.Response.Body, 2048);
}

I found some code on online that stream the audio in buffers but I haven’t been able to convert the audio buffer to audio format. In this example it gets an error that the source can’t be changed when played. I hope there is a way the append the buffer to a playing audio element.

fetch('/api/streamSong', options)
 .then((response) => response.body)
    .then((rb) => {
        const reader = rb.getReader();

        return new ReadableStream({
            start(controller) {
                // The following function handles each data chunk
                function push() {
                    // "done" is a Boolean and value a "Uint8Array"
                    reader.read().then(({ done, value }) => {
                        // If there is no more data to read
                        if (done) {
                            console.log("done", done);
                            controller.close();
                            return;
                        }
                        // Get the data and send it to the browser via the controller
                        controller.enqueue(value);
                        // Check chunks by logging to the console
                        console.log(done, value);
                        push();

                        const length = buffer.length;

                        resizeBuffer(buffer.length + value.length);

                        buffer.data.set(buffer.data, 0);
                        buffer.data.set(value, length);

                        const blob = new Blob([buffer.data], { type: 'audio/wav' });
                        const objectURL = URL.createObjectURL(blob);
                        audioElement.src = objectURL;