public function createAudioStreamFromResource($resource, $chunkSize = 32000)
    {
        while (!feof($resource)) {
            $chunk = fread($resource, $chunkSize);
            if (strlen($chunk) > 0) {
                yield $chunk;
            }
        }
    }