Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Different audio device in System.Speech.Synthesis

Different audio device in System.Speech.Synthesis

Scheduled Pinned Locked Moved C#
questionhelptutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Firedragonweb
    wrote on last edited by
    #1

    Hi, I'm writing an application that uses an System.Speech.Synthesis.SpeechSynthesizer to generate some speech. The class has a method to set the output to the default audio device or to another audiostream (System.IO.Stream). But how can I tell it to use just another audio device? I think I might have to get a Stream object of that other device to pass it to the SetOutputToAudioStream() method of the synthesizer, but I have no clue how to do so. Any help would be appreciated. Michael.

    D 2 Replies Last reply
    0
    • F Firedragonweb

      Hi, I'm writing an application that uses an System.Speech.Synthesis.SpeechSynthesizer to generate some speech. The class has a method to set the output to the default audio device or to another audiostream (System.IO.Stream). But how can I tell it to use just another audio device? I think I might have to get a Stream object of that other device to pass it to the SetOutputToAudioStream() method of the synthesizer, but I have no clue how to do so. Any help would be appreciated. Michael.

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      This MSDN[^] page might help? Edit: Sorry just realised this if for mobile devices!

      Dave

      1 Reply Last reply
      0
      • F Firedragonweb

        Hi, I'm writing an application that uses an System.Speech.Synthesis.SpeechSynthesizer to generate some speech. The class has a method to set the output to the default audio device or to another audiostream (System.IO.Stream). But how can I tell it to use just another audio device? I think I might have to get a Stream object of that other device to pass it to the SetOutputToAudioStream() method of the synthesizer, but I have no clue how to do so. Any help would be appreciated. Michael.

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        This[^] may be more help!

        Dave

        F 1 Reply Last reply
        0
        • D DaveyM69

          This[^] may be more help!

          Dave

          F Offline
          F Offline
          Firedragonweb
          wrote on last edited by
          #4

          Thanks a lot, that should do it. I'll try it later.

          F 1 Reply Last reply
          0
          • F Firedragonweb

            Thanks a lot, that should do it. I'll try it later.

            F Offline
            F Offline
            Firedragonweb
            wrote on last edited by
            #5

            Ok, here's a new problem: Filler()(from the link above) is called, while the synthesizer is still filling the stream with data. As you can imagine, this results in a disaster. So I cannot make the stream thread-safe (because can't control the filling end) and even if i could, I would have gasps in my output because the buffer would be filled like this: (1 =data in cycle 1 2=data in cycle 2 0= no data) 11111111111111111100000000000000000 |stream is filled until here 22222222222222222220000000000000000 while it should look like this: 1111111111111111112222222222222222222 Any ideas? Edit: Ok, finally got it - i had to wrap the whole synthesizer-class to make the stream thread-safe, but finally, it works. Thanks @ all.

            modified on Tuesday, June 24, 2008 2:46 PM

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups