File tree Expand file tree Collapse file tree 1 file changed +43
-4
lines changed Expand file tree Collapse file tree 1 file changed +43
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,45 @@ export = wavefile;
77
88declare module wavefile {
99
10+ type FormatChunk = {
11+ /** @type {string } */
12+ chunkId : 'fmt ' ;
13+ /** @type {number } */
14+ chunkSize : number ;
15+ /** @type {number } */
16+ audioFormat : number ;
17+ /** @type {number } */
18+ numChannels : number ;
19+ /** @type {number } */
20+ sampleRate : number ;
21+ /** @type {number } */
22+ byteRate : number ;
23+ /** @type {number } */
24+ blockAlign : number ;
25+ /** @type {number } */
26+ bitsPerSample : number ;
27+ /** @type {number } */
28+ cbSize : number ;
29+ /** @type {number } */
30+ validBitsPerSample : number ;
31+ /** @type {number } */
32+ dwChannelMask : number ;
33+ /**
34+ * 4 32-bit values representing a 128-bit ID
35+ * @type {!Array<number> }
36+ */
37+ subformat : readonly [ number , number , number , number ] ;
38+ } ;
39+
40+ type DataChunk = {
41+ /** @type {string } */
42+ chunkId : 'data' ;
43+ /** @type {number } */
44+ chunkSize : number ;
45+ /** @type {!Uint8Array } */
46+ samples : Uint8Array ;
47+ } ;
48+
1049 class WaveFile {
1150
1251 /**
@@ -19,7 +58,7 @@ declare module wavefile {
1958 * 'RIFF', 'RIFX' and 'RF64' are supported.
2059 * @type {string }
2160 */
22- container : string ;
61+ container : 'RIFF' | 'RIFX' | 'RF64' ;
2362 /**
2463 * @type {number }
2564 */
@@ -29,12 +68,12 @@ declare module wavefile {
2968 * Always 'WAVE'.
3069 * @type {string }
3170 */
32- format : string ;
71+ format : 'WAVE' ;
3372 /**
3473 * The data of the 'fmt' chunk.
3574 * @type {!Object<string, *> }
3675 */
37- fmt : object ;
76+ fmt : FormatChunk ;
3877 /**
3978 * The data of the 'fact' chunk.
4079 * @type {!Object<string, *> }
@@ -70,7 +109,7 @@ declare module wavefile {
70109 * The data of the 'data' chunk.
71110 * @type {!Object<string, *> }
72111 */
73- data : object ;
112+ data : DataChunk ;
74113 /**
75114 * The data of the 'LIST' chunks.
76115 * Each item in this list look like this:
You can’t perform that action at this time.
0 commit comments