问题1:c++中的unsigned short * pSndData,使用C#表示是否应该是System.UIntPtr pSndData?
问题2:我打算读取UIntPrt指向的地址的数据,然后写入文件,这个应该怎么实现?
       c++中使用了std::ofstream fout(cSndName,ios::binary);
                  fout.write((char *)pSndData,nSndSize);
       写入,C#中呢?
请大家帮帮忙吧,查了1天资料了,毫无进展^_^

解决方案 »

  1.   

    unsigned short * pSndData
    两个可能:
    1. System.UInt16 pSndData
    2. System.UInt16[] pSndData写文件,可能参考 System.IO 命名空间。
      

  2.   

    这个是SDK中的函数原型
    FnxTtsSynthText( FNX_TTS_SB_PTR lpSoundbank, unsigned short **output, unsigned int *nInOutBytes, const char *szInput, const int iFlags )
    C#托管后如下
    FnxTtsSynthText(System.IntPtr lpSoundBank,ref System.UIntPtr output, ref System.Int32 outsize, System.String input, System.Int16 iflags)
    请问这样有错误么?第2和第3个参数是我问题的关键呢^_^
      

  3.   

    如果是函数调用的话,声明函数原形的时候用System.UInt16
      

  4.   

    如果使用System.UInt16声明,那么怎么写入Wave文件呢?我在楼上提供的函数原型会返回一个填充好的Wave结构给output。
    BinaryWriter写入的话,只是一个整数,并不是Wave。