Browse Source

Plot diagram

pull/42/head
Jure Šorn 5 years ago
parent
commit
e2f1968961
3 changed files with 32 additions and 16 deletions
  1. 16
      README.md
  2. 16
      index.html
  3. 16
      web/script_2.js

16
README.md

@ -2679,14 +2679,14 @@ nframes = <Wave_read>.getnframes() # Number of frames.
### Sample Values
```text
┏━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━┯━━━━━━━━━━━━━┓
┃ sampwidth │ min │ zero │ max ┃
┠───────────┼─────────────┼──────┼─────────────┨
┃ 1 │ 0 │ 128 │ 255 ┃
┃ 2 │ -32768 │ 0 │ 32767 ┃
┃ 3 │ -8388608 │ 0 │ 8388607 ┃
┃ 4 │ -2147483648 │ 0 │ 2147483647 ┃
┗━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━━━━━┛
+-----------+-------------+------+-------------+
| sampwidth | min | zero | max |
+-----------+-------------+------+-------------+
| 1 | 0 | 128 | 255 |
| 2 | -32768 | 0 | 32767 |
| 3 | -8388608 | 0 | 8388607 |
| 4 | -2147483648 | 0 | 2147483647 |
+-----------+-------------+------+-------------+
```
### Read Float Samples from WAV File

16
index.html

@ -2275,14 +2275,14 @@ nframes = &lt;Wave_read&gt;.getnframes() <span class="hljs-comment"
<li><strong>If sample width is one, then the integer should be encoded as unsigned.</strong></li>
<li><strong>For all other sizes the integer should be encoded as signed with little-endian byte order.</strong></li>
</ul>
<div><h3 id="samplevalues">Sample Values</h3><pre><code class="text language-text">┏━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━┯━━━━━━━━━━━━━┓
┃ sampwidth │ min │ zero │ max ┃
┠───────────┼─────────────┼──────┼─────────────┨
┃ 1 │ 0 │ 128 │ 255 ┃
┃ 2 │ -32768 │ 0 │ 32767 ┃
┃ 3 │ -8388608 │ 0 │ 8388607 ┃
┃ 4 │ -2147483648 │ 0 │ 2147483647 ┃
┗━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━━━━━┛
<div><h3 id="samplevalues">Sample Values</h3><pre><code class="text language-text">+-----------+-------------+------+-------------+
| sampwidth | min | zero | max |
+-----------+-------------+------+-------------+
| 1 | 0 | 128 | 255 |
| 2 | -32768 | 0 | 32767 |
| 3 | -8388608 | 0 | 8388607 |
| 4 | -2147483648 | 0 | 2147483647 |
+-----------+-------------+------+-------------+
</code></pre></div>
<div><h3 id="readfloatsamplesfromwavfile">Read Float Samples from WAV File</h3><pre><code class="python language-python hljs"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">read_wav_file</span><span class="hljs-params">(filename)</span>:</span>

16
web/script_2.js

@ -177,6 +177,21 @@ const DIAGRAM_10_B =
'┃ index() │ ValueError │ │ ┃\n' +
'┗━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━┛\n';
const DIAGRAM_11_A =
'+-----------+-------------+------+-------------+\n' +
'| sampwidth | min | zero | max |\n' +
'+-----------+-------------+------+-------------+\n';
const DIAGRAM_11_B =
'┏━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━┯━━━━━━━━━━━━━┓\n' +
'┃ sampwidth │ min │ zero │ max ┃\n' +
'┠───────────┼─────────────┼──────┼─────────────┨\n' +
'┃ 1 │ 0 │ 128 │ 255 ┃\n' +
'┃ 2 │ -32768 │ 0 │ 32767 ┃\n' +
'┃ 3 │ -8388608 │ 0 │ 8388607 ┃\n' +
'┃ 4 │ -2147483648 │ 0 │ 2147483647 ┃\n' +
'┗━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━━━━━┛\n';
// isFontAvailable:
(function(d){function c(c){b.style.fontFamily=c;e.appendChild(b);f=b.clientWidth;e.removeChild(b);return f}var f,e=d.body,b=d.createElement("span");b.innerHTML=Array(100).join("wi");b.style.cssText=["position:absolute","width:auto","font-size:128px","left:-99999px"].join(" !important;");var g=c("monospace"),h=c("serif"),k=c("sans-serif");window.isFontAvailable=function(b){return g!==c(b+",monospace")||k!==c(b+",sans-serif")||h!==c(b+",serif")}})(document);
@ -192,6 +207,7 @@ if (isFontAvailable('Menlo')) {
$(`code:contains(${DIAGRAM_8_A})`).html(DIAGRAM_8_B);
$(`code:contains(${DIAGRAM_9_A})`).html(DIAGRAM_9_B);
$(`code:contains(${DIAGRAM_10_A})`).html(DIAGRAM_10_B);
$(`code:contains(${DIAGRAM_11_A})`).html(DIAGRAM_11_B);
}
var isMobile = false;

Loading…
Cancel
Save