andrewrk / andrewrk/node-waveform

Encoding error on Ubuntu 14.04

Đang mở
#6 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
102
Fork
18
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I'm trying to get the waveform of a file as JSON using the following options:

``` js
var options = { scan: false,
waveformjs: '-',
'wjs-width': 34112,
'wjs-precision': 2,
'wjs-plain': true
};

waveform(myFilePath,options,function(err,buf){
var parsed = JSON.parse(buf);
// do stuff with parsed
});
```

This works fine on OS X, but running the same thing on Ubuntu 14.04 I get the following error:

```
string_decoder.js:24
throw new Error('Unknown encoding: ' + encoding);
^
Error: Unknown encoding: buffer
at assertEncoding (string_decoder.js:24:11)
at new exports.StringDecoder (string_decoder.js:30:3)
at Socket.Readable.setEncoding (_stream_readable.js:196:33)
at exports.execFile (child_process.js:672:16)
at module.exports (/home/ubuntu/animator/node_modules/waveform/index.js:22:3)
```

This is after installing `libgroove-dev`.

If i run the command directly:

```
./waveform --wjs-width 34112 --wjs-precision 4 --wjs-plain myFilePath --waveformjs -
```

it works fine. Somehow it seems like the node wrapper isn't able to correctly encode/decode the stdout buffer on Ubuntu even though it's OK on Mac. Any idea why this would be?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.