blob.hpp文件

tech2023-05-30  52

blob.hpp文件

I host a podcast called The Indie Dev Podcast where I interview game developers from around the world in 30 minute segments. I’m always fascinated by what people are able to create, and I’m even more curious about how they make these games happen.

我主持了一个名为The Indie Dev Podcast的播客 ,我在30分钟内采访了来自世界各地的游戏开发人员。 我总是对人们能够创造的东西着迷,并且我对他们如何使这些游戏成为现实更加好奇。

I store the most recent episodes of the podcast on PodOmatic, which allows them to be picked up by iTunes and other podcast feed readers, but I am limited by the number of podcast episodes that I can store at once because I am using the free tier. My older episodes are lost unless I upgrade to the premium tier.

我将Podcast的最新剧集存储在PodOmatic上,以便iTunes和其他Podcast Feed阅读器可以接收它们,但是由于我正在使用免费套餐,因此我一次可以存储的Podcast剧集数量受到了限制。 。 除非升级到高级级别,否则我的旧剧集将丢失。

Blob存储解决了什么问题? (What Problem Does Blob Storage Solve?)

With blob storage, I can take all of my .mp3s, store them in a container, and then allow the public to download them from the container.

使用Blob存储,我可以将所有.mp3都存储在一个容器中,然后允许公众从该容器中下载它们。

When I upload my files to a blob container, I am given an HTTP endpoint, which I can use as a link to download an episode. Click on this link to download the most recent episode with Michael Hicks. You could do the same for videos that you record, too.

当我将文件上传到Blob容器时,会得到一个HTTP端点,可以将其用作下载剧集的链接。 单击此链接下载Michael Hicks的最新剧集。 您也可以对录制的视频执行相同的操作。

In this tutorial, I’m going to walk you through the steps of how I set up my container to host all of the .mp3s of the podcast.

在本教程中,我将引导您完成如何设置容器以托管播客的所有.mp3的步骤。

Blob存储如何工作? (How Does Blob Storage Work?)

Blob storage is a service for storing large amounts of unstructured data, such as text or binary data, that can be accessed from anywhere in the world via HTTP or HTTPS. You can make these files public or private as well, which means that you can use it as a storage repo for your own content for only you to access, or perhaps use it as a cost-effective way to store large amounts of media to share with others.

Blob存储是一种用于存储大量非结构化数据(例如文本或二进制数据)的服务,可以通过HTTP或HTTPS从世界任何地方访问这些数据。 您还可以将这些文件设为公共或私有文件,这意味着您可以将其用作自己内容的存储库,以供您自己访问,或者可以作为一种经济高效的方式来存储大量要共享的媒体和其他人。

Common uses of Blob storage include:

Blob存储的常见用途包括:

Serving images, documents, audio, or video directly to a browser

直接向浏览器提供图像,文档,音频或视频 Storing files for to be distributed to others

存储要分发给其他人的文件 Streaming video and audio

流式传输视频和音频 Performing secure backup and disaster recovery

执行安全备份和灾难恢复

You can find out more about Blob Storage here.

您可以在此处找到有关Blob存储的更多信息。

Blob概念和术语 (Blob concepts and terms)

Storage Account: All access to Azure Storage is done through a storage account.

存储帐户:对Azure存储的所有访问都是通过存储帐户完成的。

Container: A container provides a grouping of a set of blobs. All blobs must be in a container.

容器:容器提供一组blob的分组。 所有斑点都必须放在容器中。

Blob: A file of any type and size. There are two types of blobs that can be stored in Azure Storage: block and page blobs. Most files are block blobs, and we’re going to use those for this tutorial. A single block blob can be up to 200 GB in size.

Blob:任何类型和大小的文件。 Azure存储中可以存储两种类型的Blob:块Blob和页面Blob。 大多数文件都是块Blob,我们将在本教程中使用它们。 单个块Blob的最大大小为200 GB。

URL format: Blobs are addressable using the following URL format: http://.blob.core.windows.net// The following example URL could be used to address one of the blobs in the diagram above: http://sally.blob.core.windows.net/movies/MOV1.AVI

URL格式:可使用以下URL格式对Blob进行寻址:http://.blob.core.windows.net//以下示例URL可用于解决上图中的一个Blob: http:// sally。 blob.core.windows.net/movies/MOV1.AVI

如何获得Blob存储? (How Do I Get Blob Storage?)

You’ll need a cloud storage solution like Azure. You can sign up for a free Azure trial, or reach out to me about information on how to obtain a BizSpark account. This is what I use to host the files but you can follow along if you prefer other solutions too.

您将需要像Azure这样的云存储解决方案。 您可以注册免费的Azure试用版 ,或者与我联系以获取有关如何获取BizSpark帐户的信息 。 这就是我用来托管文件的方式,但是如果您也喜欢其他解决方案,也可以遵循。

创建一个存储帐户 (Creating a Storage Account)

You’ve got an understanding of how blob storage works now, as well why you’d want to use it. Let’s go through the process of creating an account and a container. This is directly from the blob storage blogs on the Azure portal:

您已经了解了Blob存储现在如何工作,以及为什么要使用它。 让我们完成创建帐户和容器的过程。 这直接来自Azure门户上的Blob存储博客:

To use Azure storage, you’ll need a storage account. You can create a storage account by following these steps. (You can also create a storage account by using the Azure service management client library or the service management REST API.)

要使用Azure存储,您需要一个存储帐户。 您可以按照以下步骤创建存储帐户。 (您还可以使用Azure服务管理客户端库或服务管理REST API创建存储帐户。)

Log into the Azure Management Portal.

登录到Azure管理门户 。

At the bottom of the navigation pane, click NEW.

在导航窗格的底部,单击“ 新建”。

Click DATA SERVICES, then STORAGE, and then click QUICK CREATE.

单击“ 数据服务”,然后单击“ 存储”,然后单击“ 快速创建”。

In URL, type a subdomain name to use in the URI for the storage account. This value becomes the host name within the URI that is used to address Blob, Queue, or Table resources for the subscription.

在URL中,键入要在存储帐户的URI中使用的子域名。 此值将成为URI中的主机名,该主机名用于寻址预订的Blob,队列或表资源。

Choose a Region/Affinity Group in which is closest to your current location.

选择一个最接近您当前位置的地区/相似性组。

Optionally, you can select the type of replication you desire for your account. Geo-redundant replication is the default and provides maximum durability, meaning your files will be backed up across multiple datacenters in the same area. So if Godzilla takes out one datacenter, your info is still backed up in another one.

(可选)您可以选择帐户所需的复制类型。 地理冗余复制是默认设置,可提供最大的持久性,这意味着您的文件将在同一区域的多个数据中心之间进行备份。 因此,如果Godzilla取出一个数据中心,您的信息仍将备份到另一个数据中心。

Click CREATE STORAGE ACCOUNT.

点击创建存储帐户 。

You’re ready to roll. Now you can create a container which will host your files.

您已经准备好开始滚动。 现在,您可以创建一个容器来托管您的文件。

创建一个容器 (Creating a Container)

In the Azure portal, click on the Storage icon on the left hand side of the screen. A new screen will appear with the name of the account you created above. In my case, it is called blobindiedev.

在Azure门户中,单击屏幕左侧的“ 存储”图标。 将出现一个新屏幕,上面有您在上面创建的帐户的名称。 就我而言,它称为blobindiedev。

Click on the name of the blob, then Containers at the top of the page. You’ll make a new one here. At the bottom of the page, click on Add to create a new container.

单击Blob的名称,然后单击页面顶部的“ 容器 ”。 您将在这里新建一个。 在页面底部,单击添加以创建一个新容器。

I called mine podcastep , as this will hold all of my episodes.

我称呼我的podcastep ,因为它将保存我的所有剧集。

By default, the container is private and can be accessed only by the account owner. To allow public read access to the blobs (.mp3s)in the container, but not the container properties and metadata, use the “Public Blob” option. To allow full public read access for the container and blobs, use the “Public Container” option. We want Public Container.

默认情况下,该容器是私有的,只能由帐户所有者访问。 要允许公共读取访问容器中的Blob(.mp3s),但不允许访问容器属性和元数据,请使用“公共Blob”选项。 要允许对容器和Blob进行完全公共的读取访问,请使用“公共容器”选项。 我们想要公共容器。

We’re ready to upload files to this container from Visual Studio now.

现在,我们准备从Visual Studio将文件上传到此容器。

从Visual Studio上传文件 (Uploading Files from Visual Studio)

For this part you’ll need Visual Studio. You can download the VS 2013 Community Edition for free from here. You’ll also need the Azure SDK to access your Azure account from Visual Studio. Download the SDK here. You’ll need the SDK that matches the version of Visual Studio you are using. If you have VS 2013 installed, you’ll want to use the VS 2013 Azure SDK.

对于这一部分,您将需要Visual Studio。 您可以从此处免费下载VS 2013 Community Edition。 您还需要Azure SDK从Visual Studio访问您的Azure帐户。 在此处下载SDK。 您需要与您使用的Visual Studio版本匹配的SDK。 如果已安装VS 2013,则需要使用VS 2013 Azure SDK。

With that installed, open Visual Studio, click on the Server Explorer and look for the Azure button. Click on Storage and it should ask you to log in to your account.

安装后,打开Visual Studio,单击“ 服务器资源管理器”,然后查找Azure按钮。 单击存储 ,它会要求您登录到您的帐户。

Click on Storage and you should see the new Blob storage account you created as well as container which will host the episodes.

单击“存储”,您应该会看到您创建的新Blob存储帐户以及用于托管剧集的容器。

Click on the Blobs icon / text to see your container. I see podcastep, as well as any files I have uploaded there.

单击Blobs图标/文本以查看您的容器。 我看到podcastep以及我在那里上传的所有文件。

To upload your own files, click on the Upload Blob icon, which is an arrow pointing to a horizontal line.

要上传自己的文件,请单击“上传Blob”图标,该图标是指向水平线的箭头。

A pop-up window will appear, and ask you to browse to the file you want to upload.

将会出现一个弹出窗口,要求您浏览到要上传的文件。

In my case, I’m looking for podcast episodes. You should see the Azure Activity Log appear at the bottom of the screen, which notifies you of the file’s current status.

就我而言,我正在寻找播客节目。 您应该看到“ Azure活动日志”出现在屏幕底部,该通知通知您文件的当前状态。

Once it has completed uploading, right click on the file, and copy the URL.

上传完成后,右键单击文件,然后复制URL。

That URL is how others can download your files now! On my webpage I provide a link to that URL on every episode, and folks now all of my episodes are made available!

该URL是其他人现在可以下载您的文件的方式! 在我的网页上,我在每个情节上都提供了指向该URL的链接,现在我所有的情节都可以使用了!

If you navigate back to the Azure Portal, you can see that they are all there too.

如果您导航回Azure门户,则可以看到它们也都在那里。

结论 (Conclusion)

Azure Blob Storage is a cost-effective way of saving and service content across the internet. The blob storage page has more information, but hopefully after this, you understand the value in it. I can record my podcast and easily serve it to anyone around the world, without having to pay monthly fees or build any hardware on my own. Best of all, it took me a total of 5 minutes to get the files online.

Azure Blob存储是一种经济高效的方式,可以在Internet上保存和服务内容。 Blob存储页面包含更多信息,但希望在此之后您了解其中的价值。 我可以录制我的播客,并轻松地将其提供给世界各地的任何人,而无需每月支付费用或自行构建任何硬件。 最棒的是,我总共花了5分钟才能使文件在线。

Any questions? Feel free to reach out.

任何问题? 随时与我们联系。

Here’s a full list of the tutorials in this series:

这是本系列教程的完整列表:

Intro to HTML5 video

HTML5视频简介

Intro to Azure Media services, AES, and PlayReady DRM

Azure媒体服务,AES和PlayReady DRM简介

Live streaming HTML5 video using Azure Media Services

使用Azure Media Services实时流式传输HTML5视频

Using Azure Blob Storage to store & serve your audio and video files

使用Azure Blob存储存储和提供音频和视频文件

Use this Azure Media Player for streaming Media Service video to all devices

使用此Azure Media Player将媒体服务视频流式传输到所有设备

Uploading video to Azure Media Services

将视频上传到Azure媒体服务

This article is part of the web dev tech series from Microsoft. We’re excited to share Microsoft Edge and the new EdgeHTML rendering engine with you. Get free virtual machines or test remotely on your Mac, iOS, Android, or Windows device @ dev.modern.ie

本文是Microsoft的Web开发技术系列的一部分。 我们很高兴与您共享Microsoft Edge和新的EdgeHTML渲染引擎 。 获取免费的虚拟机或在Mac,iOS,Android或Windows设备上进行远程测试@ dev.modern.ie

翻译自: https://www.sitepoint.com/blob-storage-host-podcast-mp3-files/

blob.hpp文件

最新回复(0)