This project has moved and is read-only. For the latest updates, please go here.

truespeech decompress with naudio

Feb 10, 2012 at 6:33 AM
Edited Feb 10, 2012 at 6:53 AM

ive got truespeech data which i need to play with naudio.

96 bytes of data is to be played on an interval of 85 ms. how do i accomplish this?


MemoryStream ms = new MemoryStream(Encoding.Default.GetBytes(truepeechdata));

RawSourceWaveStream rws = new RawSourceWaveStream(ms, WaveFormat.CreateMuLawFormat(8000, 1));            WaveFormatConversionStream pcmStream = (WaveFormatConversionStream)WaveFormatConversionStream.CreatePcmStream(rws); 

 WaveOut wo = new WaveOut(this.Handle); 




something like this produce a tick sound..

Feb 12, 2012 at 7:34 PM

you are marking your rawsourcewavestream as being mulaw, but if it is truespeech, then you will need to pass in the correct WaveFormat. Use the TrueSpeechWaveFormat class instead.

Feb 14, 2012 at 8:57 AM
Edited Feb 14, 2012 at 9:36 AM

i used the truespeechwaveformat class and the sound is playing but its too much breaking in between.


TrueSpeechWaveFormat tspf = new TrueSpeechWaveFormat();

WaveOut wo = new WaveOut(this.Handle);

MemoryStream ms = new MemoryStream(Encoding.Default.GetBytes(dataToPlay));

RawSourceWaveStream rws = new RawSourceWaveStream(ms, tspf);      

 WaveFormatConversionStream pcmStream = (WaveFormatConversionStream)WaveFormatConversionStream.CreatePcmStream(rws);   




do i need to change any truespeech format? bits per second or anything?

Feb 14, 2012 at 9:29 AM
Edited Feb 14, 2012 at 9:29 AM

yes, well actually it would be more like new TrueSpeechWaveFormat(...)

Feb 14, 2012 at 3:57 PM
markheath wrote:

yes, well actually it would be more like new TrueSpeechWaveFormat(...)

TrueSpeechWaveFormat(..) nothing in there to specify :|


cud you be more specific pls?

Feb 17, 2012 at 10:11 PM

just do new TrueSpeechWaveFormat()