Skip to content

Commit

Permalink
Update README for v5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rochars committed Jul 1, 2018
1 parent a486606 commit e23d963
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 90 deletions.
52 changes: 1 addition & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm install alawmulaw
### ES6
Import from **alawmulaw.js**:
```javascript
import * as alawmulaw from 'alawmulaw';
import * as alawmulaw from 'alawmulaw.js';
let aLawSamples = alawmulaw.alaw.encode(pcmSamples);
```

Expand Down Expand Up @@ -68,56 +68,6 @@ Or as a ES6 module in modern browsers from [jspm](https://jspm.io):
</script>
```

## Encode / Decode:

### A-Law
Full files:
```javascript
const alaw = require('alawmulaw').alaw;

// Encode all the samples in a file
// Only 16-bit samples are supported
aLawSamples = alaw.encode(pcmSamples);

// Decompressing all the samples in a file
pcmSamples = alaw.decode(aLawSamples);
```

Sample by sample:
```javascript
const alaw = require('alawmulaw').alaw;

// Encoding
aLawSample = alaw.encodeSample(pcmSample);

// Decoding
pcmSample = alaw.decodeSample(aLawSample);
```

### mu-Law
Full files:
```javascript
const mulaw = require('alawmulaw').mulaw;

// Encode all the samples in a file
// Only 16-bit samples are supported
muLawSamples = mulaw.encode(pcmSamples);

// Decode all the samples in a file
pcmSamples = mulaw.decode(muLawSamples);
```

Sample by sample:
```javascript
const mulaw = require('alawmulaw').mulaw;

// Encoding
muLawSample = mulaw.encodeSample(pcmSample);

// Decoding
pcmSample = mulaw.decodeSample(muLawSample);
```

## API

### alawmulaw.alaw
Expand Down
36 changes: 3 additions & 33 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-al
<p><a href="https://www.npmjs.com/package/alawmulaw"><img src="https://img.shields.io/npm/v/alawmulaw.svg?style=for-the-badge" alt="NPM version"></a> <a href="https://rochars.github.io/alawmulaw/index.html"><img src="https://img.shields.io/badge/docs-online-blue.svg?style=for-the-badge" alt="Docs"></a><br><a href="https://codecov.io/gh/rochars/alawmulaw"><img src="https://img.shields.io/codecov/c/github/rochars/alawmulaw.svg?style=flat-square" alt="Codecov"></a> <a href="https://travis-ci.org/rochars/alawmulaw"><img src="https://img.shields.io/travis/rochars/alawmulaw.svg?style=flat-square" alt="Unix Build"></a> <a href="https://ci.appveyor.com/project/rochars/alawmulaw"><img src="https://img.shields.io/appveyor/ci/rochars/alawmulaw.svg?style=flat-square&amp;logo=appveyor" alt="Windows Build"></a> <a href="https://scrutinizer-ci.com/g/rochars/alawmulaw/"><img src="https://img.shields.io/scrutinizer/g/rochars/alawmulaw.svg?style=flat-square&amp;logo=scrutinizer" alt="Scrutinizer"></a></p>
<p>A-Law and mu-Law codecs in JavaScript.</p>
<h2>Install</h2><pre class="prettyprint source"><code>npm install alawmulaw</code></pre><h2>Use</h2><h3>ES6</h3><p>Import from <strong>alawmulaw.js</strong>:</p>
<pre class="prettyprint source lang-javascript"><code>import * as alawmulaw from 'alawmulaw';
<pre class="prettyprint source lang-javascript"><code>import * as alawmulaw from 'alawmulaw.js';
let aLawSamples = alawmulaw.alaw.encode(pcmSamples);</code></pre><h3>Node</h3><p>Require from 'alawmulaw'</p>
<pre class="prettyprint source lang-javascript"><code>const alawmulaw = require('alawmulaw');

Expand All @@ -76,37 +76,7 @@ <h2>Install</h2><pre class="prettyprint source"><code>npm install alawmulaw</cod
<pre class="prettyprint source lang-html"><code>&lt;script type=&quot;module&quot;>
import * as alawmulaw from 'https://dev.jspm.io/alawmulaw';
// ...
&lt;/script></code></pre><h2>Encode / Decode:</h2><h3>A-Law</h3><p>Full files:</p>
<pre class="prettyprint source lang-javascript"><code>const alaw = require('alawmulaw').alaw;

// Encode all the samples in a file
// Only 16-bit samples are supported
aLawSamples = alaw.encode(pcmSamples);

// Decompressing all the samples in a file
pcmSamples = alaw.decode(aLawSamples);</code></pre><p>Sample by sample:</p>
<pre class="prettyprint source lang-javascript"><code>const alaw = require('alawmulaw').alaw;

// Encoding
aLawSample = alaw.encodeSample(pcmSample);

// Decoding
pcmSample = alaw.decodeSample(aLawSample);</code></pre><h3>mu-Law</h3><p>Full files:</p>
<pre class="prettyprint source lang-javascript"><code>const mulaw = require('alawmulaw').mulaw;

// Encode all the samples in a file
// Only 16-bit samples are supported
muLawSamples = mulaw.encode(pcmSamples);

// Decode all the samples in a file
pcmSamples = mulaw.decode(muLawSamples);</code></pre><p>Sample by sample:</p>
<pre class="prettyprint source lang-javascript"><code>const mulaw = require('alawmulaw').mulaw;

// Encoding
muLawSample = mulaw.encodeSample(pcmSample);

// Decoding
pcmSample = mulaw.decodeSample(muLawSample);</code></pre><h2>API</h2><h3>alawmulaw.alaw</h3><pre class="prettyprint source lang-javascript"><code>
&lt;/script></code></pre><h2>API</h2><h3>alawmulaw.alaw</h3><pre class="prettyprint source lang-javascript"><code>
/**
* Encode a 16-bit linear PCM sample as 8-bit A-Law.
* @param {number} sample A 16-bit PCM sample
Expand Down Expand Up @@ -471,7 +441,7 @@ <h2>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:33:06 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:58:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:33:06 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:58:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_alaw.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ <h1 class="page-title">lib/alaw.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:33:06 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:58:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_mulaw.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ <h1 class="page-title">lib/mulaw.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:33:06 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:58:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-alawmulaw.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h1 class="page-title">alawmulaw</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:33:06 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:58:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-alawmulaw_alaw.html
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:33:06 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:58:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-alawmulaw_mulaw.html
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:33:06 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 01 2018 00:58:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down

0 comments on commit e23d963

Please sign in to comment.