This project has moved. For the latest updates, please go here.

truespeech decompress with naudio

Feb 10, 2012 at 5:33 AM
Edited Feb 10, 2012 at 5: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); 

wo.Init(pcmStream);

wo.Play();

 

something like this produce a tick sound..

Coordinator
Feb 12, 2012 at 6: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 7:57 AM
Edited Feb 14, 2012 at 8: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);   

wo.Init(pcmStream);

wo.Play();

 

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

Coordinator
Feb 14, 2012 at 8:29 AM
Edited Feb 14, 2012 at 8:29 AM

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

Feb 14, 2012 at 2: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?

Coordinator
Feb 17, 2012 at 9:11 PM

just do new TrueSpeechWaveFormat()