Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Sure, you can do this in three possible ways:</p> <ol> <li><p>Include it as a binary property on an existing entity (usually the service hosts entities representing each audio file in this case, which would have one of its properties being the actual audio mp3). In code this is just to declare a property of type byte[] (And fill it in). The upside is that this is really easy to setup. The downside is that when you GET such entity the entire mp3 gets downloaded and it's transferred as BASE64 encoded text, so it's big on the wire.</p></li> <li><p>Similar setup as above, but instead of storing the mp3 in a binary property you make the entity a Media Resource Entry, you make it have a default stream value. This is described in this blog post in more detail: <a href="http://blogs.msdn.com/b/astoriateam/archive/2010/08/04/data-services-streaming-provider-series-implementing-a-streaming-provider-part-1.aspx" rel="nofollow">http://blogs.msdn.com/b/astoriateam/archive/2010/08/04/data-services-streaming-provider-series-implementing-a-streaming-provider-part-1.aspx</a> and <a href="http://blogs.msdn.com/b/astoriateam/archive/2010/09/08/data-services-streaming-provider-series-part-2-accessing-a-media-resource-stream-from-the-client.aspx" rel="nofollow">http://blogs.msdn.com/b/astoriateam/archive/2010/09/08/data-services-streaming-provider-series-part-2-accessing-a-media-resource-stream-from-the-client.aspx</a>.</p></li> <li><p>In the latest CTP WCF DS also supports stream properties. Which is similar to #2 above but a single entity can have multiple streams each accessible by its name.</p></li> </ol> <p>To access the raw value of the audio stream you can use URL (depends on the method you use to expose the stream):</p> <ol> <li><p>urltotheentity/MyBinaryProperty/$value</p></li> <li><p>urltotheentity/$value</p></li> <li><p>urltotheentity/StreamPropertyName/$value</p></li> </ol> <p>Note that in #1 the default MIME type of the stream will be application/octet-stream, to change it you need to add an attribute MimeType for the property (reflection provider) or attribute into the CSDL for that property (EF provider). In #2 and #3 the mime type is determined via a call to the stream provider.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload