cmusphinx / node-pocketsphinx

Pocketsphinx bindings for Node.JS
Other
242 stars 47 forks source link

Assertion `val->IsUint8Array()' failed. #40

Closed dennisblokland closed 7 years ago

dennisblokland commented 7 years ago

/usr/bin/nodejs[2396]: ../src/node_buffer.cc:197:char* node::Buffer::Data(v8::Local<v8::Value>): Assertionval->IsUint8Array()' failed. 1: node::Abort() [node] 2: node::Assert(char const const () [4]) [node] 3: 0x556e0f2d54ac [node] 4: 0x7fee85c94ed3 [/home/dennis/discord-bot/node_modules/pocketsphinx/build/Release/PocketSphinx.node] 5: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo const&)) [node] 6: 0x556e0eba094e [node] 7: 0x556e0eba11df [node] 8: 0x256f353092a7 Aborted (core dumped)`

i get this error. while using this peace of code:

` var readable = receiver.createPCMStream(user)

            decoder.startUtt();
            decoder.processRaw(readable, false, false);
            decoder.endUtt();
            console.log(decoder.hyp())`

the createPCMStream returns a readable stream.

im running node v6.9.5

nshmyrev commented 7 years ago

Also it seems you are using some API for getting PCM data (that createPCMStream). You need to point which exactly API you are using.

dennisblokland commented 7 years ago

sorry forgot about that.. its discord.js and this is the function

nshmyrev commented 7 years ago

Ok, you need to get buffer of data to pass it to decoder, you are trying to pass the stream object instead. You should read data from the stream and pass to the decoder in a loop manually.