Good day! For a bad hour I can not figure out the question.
A piece of code on c ++
unsigned short cpoint1; TFileStream* wfs1=new TFileStream("Signal1.wav",fmCreate); for (i=0; i<m ; i++) { cpoint1 = wfmmas1[i]; wfs1->Write(&cpoint1,2); } delete wfs1;
Trying to rewrite to c #
ushort cpoint1; FileStream wfs1 = new FileStream("Signal1.wav", FileMode.Create); UnicodeEncoding uniEncoding = new UnicodeEncoding(); for (i=0; i<m ; i++) { cpoint1 = wfmmas1[i]; wfs1.Write(uniEncoding.GetBytes(Convert.ToString(astr)), 2, uniEncoding.GetByteCount(Convert.ToString(astr))-2); } wfs2.Close();
The problem is that the files created in the first and second case are different. I will be glad to any help! =)