Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality. If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers. And always feel free to hit us up on Twitter @MxdRealityDev.

Text to Speech

How can we do text to speech on HoloLens in Unity? I started writing my own bridge using SpeechSynthesizer but I'm a bit stumped when it comes time to play the stream. Looks like the SynthesizeTextToStreamAsync method returns a SpeechSynthesisStream. Normally you would play that with a MediaElement, but since this HoloLens app is a D3D only app I don't have XAML and I don't have MediaElement. Is there another way to play this stream? Or is there a component somewhere in the toolkit that I'm missing to enable this?

Our Holographic world is here

RoadToHolo.com      WikiHolo.net      @jbienz
I work in Developer Experiences at Microsoft. My posts are based on my own experience and don't represent Microsoft or HoloLens.

Best Answer

Answers

  • I believe your best bet would be to use XAudio2 to play the audio. You can get started with XAudio at https://msdn.microsoft.com/en-us/library/windows/desktop/ee415762(v=vs.85).aspx.

    To verify before you use XAudio2 directly, if this is a Unity app you can use Unity APIs to stream audio that way. Use of XAudio2 should only be required if you're not developing using Unity.

  • @jbienzms this is awesome! I had to use this today and found your implementation excellent!

  • Awesome @papiot! I'm so glad it helped.

    Our Holographic world is here

    RoadToHolo.com      WikiHolo.net      @jbienz
    I work in Developer Experiences at Microsoft. My posts are based on my own experience and don't represent Microsoft or HoloLens.

  • Hi @jbienzms I found your Scene in the HoloToolkit-Tests, the speech synthesis worked good, but when I asked "What time is it" there was no response, I had opened up the micphone functionality. Can you check what is the reason for that? Thanks!

  • Hi, have a look at my tutorial on Text to Speech in HoloLens using MR Toolkit latest version. https://codeholo.com/2018/04/12/texttospeech-tutorial-hololens/

  • Can you please give me the answer on following,
    1. Can we change language?
    2. What languages are supported?

Sign In or Register to comment.