5

I have audio files of differnt types (wav, mp3...) in a Azure Blob Storage. I want to stream them but i also want to stream them from a specific position in the audio file. So for example i want a stream to start at 0:00 seconds and another one to start at 01:15 seconds of the file.

Is this somehow possible? I know that there is the Method "DownloadRangeToStream". Is this possible with this method? Even if this works i think that there will be problems with the offset because the Header of the File is missing right?

I would appreciate any input!

Thanks for your help, Metabolic

metabolic
  • 669
  • 1
  • 7
  • 24

3 Answers3

6

Azure Blob Storage does not support streaming it only supports Progressive Download. It is good to have understanding of these. Because Only streaming supports seeking. Progressive Download does not support seeking.

If you are developing your own player, you can potentially take use of those DownloadRangeToStream method, but I really question the result. For real streaming with seek capabilities you will have to use Azure Media Services. Media Services supports wide range of streaming features including Smooth Streaming, Fixed bitrate streaming, progressive download, Apple HTTP Adaptive streaming (Apple HLS Streaming) etc.

astaykov
  • 30,768
  • 3
  • 70
  • 86
  • 7
    do you have any good references for strictly audio streaming with Azure Media Services? Video's well documented, but it's proven a challenge to find documentation for storage and good controllable playback streaming of just audio files. – matthewsheets Jan 23 '15 at 21:03
5

By default Azure Blob Storage service uses oldest possible version which dates to 2009-09-19 . This version doesn't support byte ranges so seeking doesn't work.

You can switch to newest version in multiple ways:

  1. using Set Blob Service Properties via HTTP REST API
  2. using Plasma/AzureBlobUtility:

    BlobUtility.exe -k <AccessKey> -a <StorageName> -c <ContainerName> --setDefaultServiceVersion 2015-02-21

  3. write your own program and use CloudBlobClient.SetServiceProperties function from Windows Azure Storage package

EDIT You can read more here Serving Video Content from Azure Blob Storage and here Hosting progressive download videos on Azure Blobs

Community
  • 1
  • 1
gumis
  • 166
  • 1
  • 11
0

The default version of Azure Blob Storage API doesn't return a Accept-Ranges: Bytes header in the response, which prevents the audio files from being seekable.

You can change the default Blob Storage API version with PowerShell, like this:

$context = New-AzStorageContext `
    -StorageAccountName <yourAccount> `
    -StorageAccountKey <key>

Update-AzStorageServiceProperty `
    -ServiceType Blob `
    -DefaultServiceVersion 2021-04-10 `
    -Context $context

Note: that requires the PowerShell Az module to be installed. You can also use the old AzureRM module, in which case your commands will be New-AzureStorageContext and Update-AzureStorageServiceProperty respectively.

Michał Jabłoński
  • 1,129
  • 1
  • 13
  • 15