Streaming to audio RRS feed

  • Question

  • I'm trying to write a Windows store app that produces audio, using javascript and html. The audio I want to make is NOT from a file. I would like to generate the audio dynamically (perhaps based on some input from the user) for an indefinite amount of time and play it in the background.

    Is there a Windows Store API that allows me to write to a buffer or stream (at some refresh interval) that gets consumed?

    How do apps that take data from radio streams get access to audio output devices? I think my problem is similar to these kinds of apps.

    Tuesday, April 9, 2013 11:58 PM

All replies

  • Hi A,

    What you can do varies wildly based on what you are trying to accomplish!

    Some apps have included various audio files to play back differently based on user input.  Others use the html <audio> tag to play web based content.  Some have customer implementations based on other components based on a WinMD component written using C++.  You should investigate these to see which would fit your particular situation best.


    Jeff Sanders (MSFT)

    Wednesday, April 10, 2013 1:45 PM
  • Thanks for the reply Jeff.

    For now, I'd like to avoid creating new components that will need to be deployed with my app.

    Your mention about the <audio> tag gave me a question. Do you know if I would be able to use the <audio> tag to play incomplete audio? For example I had the following idea:

    1) Create a stream (I'm not sure which type of stream would be appropriate).

    2) Using the stream along with the function URL.createObjectURL(), create a url.

    3) Set this url in the 'src' attribute of the <audio> tag.

    4) Write to the stream as data becomes available.

    Would this work?

    Wednesday, April 10, 2013 5:16 PM