Hi,
I try to test with online2-tcp-nnet3-decode-faster.cc.
I modified the code for my test because I use web socket, not tcp socket.
web socket output and kaldi input format is different.
web socket output is int16 array, but kaldi input is float type user defined vector.
How can I change arrary to vector?
I try to for long times but compile error happened.
here is my sample code.
for(int i=0; i<CHANNELS*userinfo->asr_session_data->frame_size; i++)
{
pcm_bytes[2*i]=(BaseFloat)(out[i]&0xFF);
pcm_bytes[2*i+1]=(BaseFloat)((out[i]>>8)&0xFF);
}
Vector<BaseFloat> wave_data;
1.
wave_data.CopyFromPtr( pcm_bytes, sizeof(pcm_bytes[0]));
2. for (int i=0; i<CHANNELS*userinfo->asr_session_data->frame_size; i++)
{
//wave_data[i] = pcm_bytes[i];:wq
std::memcpy(pcm_bytes,wave_data,sizeof(pcm_bytes[0])*CHANNELS*userinfo->asr_session_data->frame_size)
}
3. wave_data = vector(std::begin(pcm_bytes), std::end(pcm_bytes));
please someone help me.
thanks and regard/