Author Topic: [VB.NET] Playing SpeechSynthesizer stream directly?  (Read 381 times)

cyberDJ

  • Posts: 2
First of all, thank you for this wonderful library, i'm really enjoying working with it, but this time i'm stuck, mainly because i never worked with streams.
What i'm trying to accomplish is to use the .NET speech synthesis to read a text, but i would like to avoid generating a wave file and then load and play it using bass.

Speech Synthesizer has two methods of outputting the data (three with output to wave file): SetOutputToAudioStream and SetOutputToWaveStream, but i really don't know how to use any of these with bass, so please if anyone can write a small example, or at least point me in the right direction.

Thank you very much!

Ian @ un4seen

  • Administrator
  • Posts: 21358
Re: [VB.NET] Playing SpeechSynthesizer stream directly?
« Reply #1 on: 7 Mar '18 - 17:30 »
I'm not familiar with that API, so I'm not exactly sure how you should use it. It is possible to receive the sample data in a callback function? If so, you could have that function feed a BASS "push" stream, created via BASS_StreamCreate with proc=STREAMPROC_PUSH. Alternatively, if you can request sample data from it, then you could do that inside a STREAMPROC callback function. In both cases, the sample format used in the BASS_StreamCreate call should match the format of the data that is being received.

cyberDJ

  • Posts: 2
Re: [VB.NET] Playing SpeechSynthesizer stream directly?
« Reply #2 on: 8 Mar '18 - 08:00 »
Thank you very much Ian, i will play with it a bit more to see if i get it to work.