none
how to play mp3 in wcf service RRS feed

  • Question

  • now i need play mp3 by calling wcf service

    but no sound output, i search documents and know it can't output sound by calling function in wcf service

    should i what to do? 

    can anybody tell me what i should do, please~~

    thanks^_^

    Sunday, September 28, 2014 5:45 PM

All replies

  • this question have no answer?
    Monday, September 29, 2014 4:09 AM
  • Hi bradlee1986,

    Based on your description, I know that you want to play mp3 by calling the WCF Service, then please try to refer to the following example to see it helps:

    In the IService1.cs:

    [OperationContract]
    [WebInvoke(
    Method = "GET",
    UriTemplate = "/AudioStream")]
    Stream GetAudioStream();

    In the Service1.cs:

    public Stream GetAudioStream()
    {
        WebOperationContext.Current.OutgoingResponse.ContentType = "audio/mpeg";
        return new FileStream(@"c:\AudioFile.mp3", FileMode.Open);
    }

    For more information, please try to refer to the following article:
    http://mrrask.wordpress.com/2009/06/29/streaming-mp3-audio-from-a-wcf-rest-service/ .

    Best Regards,
    Amy Peng

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 29, 2014 8:31 AM
    Moderator
  • thanks for your answer, my english is poor, sorry^_^

    because existing greatewall in china, so i can't open the web wite that you give.

    i want to ask whether the method that you submitted can play mp3 in client nor in server?

    Monday, September 29, 2014 2:56 PM