Skip to content

Commit

Permalink
feat: upgrade dependencies and min. Node.js version 12.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Karres committed Feb 23, 2021
1 parent 69ac756 commit bf7580e
Show file tree
Hide file tree
Showing 9 changed files with 750 additions and 158 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ Thumbs.db
# IDE
.vscode/*
.idea/*

# Test
test/encoded.mp3
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# node-lame

<img align="right" src="https://assets.devowl.io/git/node-lame/logo.png" alt="node-lame Logo" height="180" />

LAME is an open-source encoder that encodes and decodes audio to the MP3 file format. For all MP3 needs a Node.js wrapper of the full [LAME](http://lame.sourceforge.net/) command line.

The encoder reads WAV-, MP1-, MP2- and MP3-format and encodes it into an MP3 file. The decoder reads MP3-format and decodes it into WAV.
Expand All @@ -8,7 +10,7 @@ The encoder reads WAV-, MP1-, MP2- and MP3-format and encodes it into an MP3 fil

- Linux or MacOS (This package is NOT tested on Windows)
- Lame Installed (View instructions below)
- Node 10.13.\* or newer
- Node 12.20.\* or newer

## Installation

Expand Down Expand Up @@ -47,15 +49,15 @@ const Lame = require("node-lame").Lame;

const encoder = new Lame({
output: "./audio-files/demo.mp3",
bitrate: 192
bitrate: 192,
}).setFile("./audio-files/demo.wav");

encoder
.encode()
.then(() => {
// Encoding finished
})
.catch(error => {
.catch((error) => {
// Something went wrong
});
```
Expand All @@ -67,7 +69,7 @@ const Lame = require("node-lame").Lame;

const encoder = new Lame({
output: "buffer",
bitrate: 192
bitrate: 192,
}).setFile("./audio-files/demo.wav");

encoder
Expand All @@ -76,7 +78,7 @@ encoder
// Encoding finished
const buffer = encoder.getBuffer();
})
.catch(error => {
.catch((error) => {
// Something went wrong
});
```
Expand Down Expand Up @@ -131,15 +133,15 @@ const Lame = require("node-lame").Lame;

const encoder = new Lame({
output: "buffer",
bitrate: 192
bitrate: 192,
}).setFile("./audio-files/demo.wav");

encoder
.encode()
.then(() => {
// Encoding finished
})
.catch(error => {
.catch((error) => {
// Something went wrong
});

Expand All @@ -153,7 +155,7 @@ const Lame = require("node-lame").Lame;

const encoder = new Lame({
output: "buffer",
bitrate: 192
bitrate: 192,
}).setFile("./audio-files/demo.wav");

const emitter = encoder.getEmitter();
Expand All @@ -166,7 +168,7 @@ emitter.on("finish", () => {
// On finish
});

emitter.on("error", error => {
emitter.on("error", (error) => {
// On error
});

Expand All @@ -175,7 +177,7 @@ encoder
.then(() => {
// Encoding finished
})
.catch(error => {
.catch((error) => {
// Something went wrong
});
```
Expand All @@ -186,15 +188,15 @@ encoder
const Lame = require("node-lame").Lame;

const decoder = new Lame({
output: "./audio-files/demo.wav"
output: "./audio-files/demo.wav",
}).setFile("./audio-files/demo.mp3");

decoder
.decode()
.then(() => {
// Decoding finished
})
.catch(error => {
.catch((error) => {
// Something went wrong
});
```
Expand All @@ -205,7 +207,7 @@ decoder
const Lame = require("node-lame").Lame;

const decoder = new Lame({
output: "buffer"
output: "buffer",
}).setFile("./audio-files/demo.mp3");

decoder
Expand All @@ -214,7 +216,7 @@ decoder
// Decoding finished
const buffer = decoder.getBuffer();
})
.catch(error => {
.catch((error) => {
// Something went wrong
});
```
Expand Down Expand Up @@ -266,15 +268,15 @@ decoder.decode()
const Lame = require("node-lame").Lame;

const decoder = new Lame({
output: "buffer"
output: "buffer",
}).setFile("./audio-files/demo.mp3");

decoder
.encode()
.then(() => {
// Decoding finished
})
.catch(error => {
.catch((error) => {
// Something went wrong
});

Expand All @@ -287,7 +289,7 @@ const status = decoder.getStatus();
const Lame = require("node-lame").Lame;

const decoder = new Lame({
output: "buffer"
output: "buffer",
}).setFile("./audio-files/demo.mp3");

const emitter = decoder.getEmitter();
Expand All @@ -300,7 +302,7 @@ emitter.on("finish", () => {
// On finish
});

emitter.on("error", error => {
emitter.on("error", (error) => {
// On error
});

Expand All @@ -309,7 +311,7 @@ decoder
.then(() => {
// Decoding finished
})
.catch(error => {
.catch((error) => {
// Something went wrong
});
```
Expand Down
3 changes: 2 additions & 1 deletion lib/build/Lame.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/Lame.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/build/LameOptions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/LameOptions.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit bf7580e

Please sign in to comment.