public AITalkResultCode SetParam(ref AITalk_TTtsParam param) { IntPtr pParam = AITalkMarshal.TTtsParamToIntPtr(ref param); AITalkResultCode code = AITalkAPI.SetParam(pParam); this.OnWriteLog("[AITalkAPI_SetParam] " + code); Marshal.FreeCoTaskMem(pParam); if (code == AITalkResultCode.AITALKERR_SUCCESS) { this._kanaBuf = new StringBuilder((int)param.lenTextBufBytes); this._waveBuf = new short[param.lenRawBufBytes / 2]; } return(code); }