I have in c# and winrt:
var stream = await speech.GetSpeakStreamAsync(SpeechText.Text, language);
stream
is a Windows.Storage.Streams.IRandomAccessStream
So I am completly new to c# and winrt. How i save this stream containg a wav-file to a file? Thanks in advance, Basilius
The IRandomAccessStream has a method called GetInputStreamAt http://msdn.microsoft.com/en-US/library/windows/apps/windows.storage.streams.irandomaccessstream
This gets you an IInputStream.
The IInputStream interface defines just one method, ReadAsync, which lets you read bytes into an IBuffer object. Windows.Storage.Stream also includes a DataReader class that you create based on an IInputStream object and then read numerous .NET objects from the stream as well as arrays of bytes. http://www.charlespetzold.com/blog/2011/11/080203.html , http://msdn.microsoft.com/library/windows/apps/BR208119
now you have a buffer containing all the read bytes.
you can now save this buffer to a file http://blog.jerrynixon.com/2012/06/windows-8-how-to-read-files-in-winrt.html
I can't add the code to the comment, so here is the code in vb.net: Dim gesprochenesWort As Windows.Storage.Streams.IRandomAccessStream gesprochenesWort = Await Sprich.GetSpeakStreamAsync("Das ist ein Beispieltext", "de")
;Many thanks to you.
Best regards, Basilius