|
1 | 1 | package audio
|
2 | 2 |
|
3 |
| -import "encoding/binary" |
4 |
| - |
5 | 3 | var (
|
6 |
| - // AIFF |
7 | 4 | // MONO
|
8 | 5 |
|
9 |
| - // FormatMono225008bBE mono 8bit 22.5kHz AIFF like format. |
10 |
| - FormatMono225008bBE = &Format{ |
11 |
| - NumChannels: 1, |
12 |
| - SampleRate: 22500, |
13 |
| - BitDepth: 8, |
14 |
| - Endianness: binary.BigEndian, |
15 |
| - } |
16 |
| - // FormatMono2250016bBE mono 16bit 22.5kHz AIFF like format. |
17 |
| - FormatMono2250016bBE = &Format{ |
| 6 | + // FormatMono22500 mono 22.5kHz format. |
| 7 | + FormatMono22500 = &Format{ |
18 | 8 | NumChannels: 1,
|
19 | 9 | SampleRate: 22500,
|
20 |
| - BitDepth: 16, |
21 |
| - Endianness: binary.BigEndian, |
22 |
| - } |
23 |
| - // FormatMono441008bBE mono 8bit 44.1kHz AIFF like format. |
24 |
| - FormatMono441008bBE = &Format{ |
25 |
| - NumChannels: 1, |
26 |
| - SampleRate: 44100, |
27 |
| - BitDepth: 8, |
28 |
| - Endianness: binary.BigEndian, |
29 | 10 | }
|
30 |
| - // FormatMono4410016bBE mono 16bit 44.1kHz AIFF like format. |
31 |
| - FormatMono4410016bBE = &Format{ |
| 11 | + // FormatMono44100 mono 8bit 44.1kHz format. |
| 12 | + FormatMono44100 = &Format{ |
32 | 13 | NumChannels: 1,
|
33 | 14 | SampleRate: 44100,
|
34 |
| - BitDepth: 16, |
35 |
| - Endianness: binary.BigEndian, |
36 | 15 | }
|
37 |
| - // FormatMono4410024bBE mono 24bit 44.1kHz AIFF like format. |
38 |
| - FormatMono4410024bBE = &Format{ |
| 16 | + // FormatMono48000 mono 48kHz format. |
| 17 | + FormatMono48000 = &Format{ |
39 | 18 | NumChannels: 1,
|
40 |
| - SampleRate: 44100, |
41 |
| - BitDepth: 24, |
42 |
| - Endianness: binary.BigEndian, |
| 19 | + SampleRate: 48000, |
43 | 20 | }
|
44 |
| - // FormatMono4410032bBE mono 32bit 44.1kHz AIFF like format. |
45 |
| - FormatMono4410032bBE = &Format{ |
| 21 | + // FormatMono96000 mono 96kHz format. |
| 22 | + FormatMono96000 = &Format{ |
46 | 23 | NumChannels: 1,
|
47 |
| - SampleRate: 44100, |
48 |
| - BitDepth: 32, |
49 |
| - Endianness: binary.BigEndian, |
| 24 | + SampleRate: 96000, |
50 | 25 | }
|
51 | 26 |
|
52 | 27 | // STEREO
|
53 | 28 |
|
54 |
| - // FormatStereo225008bBE Stereo 8bit 22.5kHz AIFF like format. |
55 |
| - FormatStereo225008bBE = &Format{ |
56 |
| - NumChannels: 2, |
57 |
| - SampleRate: 22500, |
58 |
| - BitDepth: 8, |
59 |
| - Endianness: binary.BigEndian, |
60 |
| - } |
61 |
| - // FormatStereo2250016bBE Stereo 16bit 22.5kHz AIFF like format. |
62 |
| - FormatStereo2250016bBE = &Format{ |
63 |
| - NumChannels: 2, |
64 |
| - SampleRate: 22500, |
65 |
| - BitDepth: 16, |
66 |
| - Endianness: binary.BigEndian, |
67 |
| - } |
68 |
| - // FormatStereo441008bBE Stereo 8bit 44.1kHz AIFF like format. |
69 |
| - FormatStereo441008bBE = &Format{ |
70 |
| - NumChannels: 2, |
71 |
| - SampleRate: 44100, |
72 |
| - BitDepth: 8, |
73 |
| - Endianness: binary.BigEndian, |
74 |
| - } |
75 |
| - // FormatStereo4410016bBE Stereo 16bit 44.1kHz AIFF like format. |
76 |
| - FormatStereo4410016bBE = &Format{ |
77 |
| - NumChannels: 2, |
78 |
| - SampleRate: 44100, |
79 |
| - BitDepth: 16, |
80 |
| - Endianness: binary.BigEndian, |
81 |
| - } |
82 |
| - // FormatStereo4410024bBE Stereo 24bit 44.1kHz AIFF like format. |
83 |
| - FormatStereo4410024bBE = &Format{ |
84 |
| - NumChannels: 2, |
85 |
| - SampleRate: 44100, |
86 |
| - BitDepth: 24, |
87 |
| - Endianness: binary.BigEndian, |
88 |
| - } |
89 |
| - // FormatStereo4410032bBE Stereo 32bit 44.1kHz AIFF like format. |
90 |
| - FormatStereo4410032bBE = &Format{ |
91 |
| - NumChannels: 2, |
92 |
| - SampleRate: 44100, |
93 |
| - BitDepth: 32, |
94 |
| - Endianness: binary.BigEndian, |
95 |
| - } |
96 |
| - |
97 |
| - // WAV |
98 |
| - // MONO |
99 |
| - |
100 |
| - // FormatMono225008bLE mono 8bit 22.5kHz WAV like format. |
101 |
| - FormatMono225008bLE = &Format{ |
| 29 | + // FormatStereo22500 Stereo 22.5kHz format. |
| 30 | + FormatStereo22500 = &Format{ |
102 | 31 | NumChannels: 1,
|
103 | 32 | SampleRate: 22500,
|
104 |
| - BitDepth: 8, |
105 |
| - Endianness: binary.LittleEndian, |
106 | 33 | }
|
107 |
| - // FormatMono2250016bLE mono 16bit 22.5kHz WAV like format. |
108 |
| - FormatMono2250016bLE = &Format{ |
109 |
| - NumChannels: 1, |
110 |
| - SampleRate: 22500, |
111 |
| - BitDepth: 16, |
112 |
| - Endianness: binary.LittleEndian, |
113 |
| - } |
114 |
| - // FormatMono441008bLE mono 8bit 44.1kHz WAV like format. |
115 |
| - FormatMono441008bLE = &Format{ |
116 |
| - NumChannels: 1, |
117 |
| - SampleRate: 44100, |
118 |
| - BitDepth: 8, |
119 |
| - Endianness: binary.LittleEndian, |
120 |
| - } |
121 |
| - // FormatMono4410016bLE mono 16bit 44.1kHz WAV like format. |
122 |
| - FormatMono4410016bLE = &Format{ |
| 34 | + // FormatStereo44100 Stereo 8bit 44.1kHz format. |
| 35 | + FormatStereo44100 = &Format{ |
123 | 36 | NumChannels: 1,
|
124 | 37 | SampleRate: 44100,
|
125 |
| - BitDepth: 16, |
126 |
| - Endianness: binary.LittleEndian, |
127 | 38 | }
|
128 |
| - // FormatMono4410024bLE mono 24bit 44.1kHz WAV like format. |
129 |
| - FormatMono4410024bLE = &Format{ |
| 39 | + // FormatStereo48000 Stereo 48kHz format. |
| 40 | + FormatStereo48000 = &Format{ |
130 | 41 | NumChannels: 1,
|
131 |
| - SampleRate: 44100, |
132 |
| - BitDepth: 24, |
133 |
| - Endianness: binary.LittleEndian, |
| 42 | + SampleRate: 48000, |
134 | 43 | }
|
135 |
| - // FormatMono4410032bLE mono 32bit 44.1kHz WAV like format. |
136 |
| - FormatMono4410032bLE = &Format{ |
| 44 | + // FormatStereo96000 Stereo 96kHz format. |
| 45 | + FormatStereo96000 = &Format{ |
137 | 46 | NumChannels: 1,
|
138 |
| - SampleRate: 44100, |
139 |
| - BitDepth: 32, |
140 |
| - Endianness: binary.LittleEndian, |
141 |
| - } |
142 |
| - |
143 |
| - // STEREO |
144 |
| - |
145 |
| - // FormatStereo225008bLE Stereo 8bit 22.5kHz WAV like format. |
146 |
| - FormatStereo225008bLE = &Format{ |
147 |
| - NumChannels: 2, |
148 |
| - SampleRate: 22500, |
149 |
| - BitDepth: 8, |
150 |
| - Endianness: binary.LittleEndian, |
151 |
| - } |
152 |
| - // FormatStereo2250016bLE Stereo 16bit 22.5kHz WAV like format. |
153 |
| - FormatStereo2250016bLE = &Format{ |
154 |
| - NumChannels: 2, |
155 |
| - SampleRate: 22500, |
156 |
| - BitDepth: 16, |
157 |
| - Endianness: binary.LittleEndian, |
158 |
| - } |
159 |
| - // FormatStereo441008bLE Stereo 8bit 44.1kHz WAV like format. |
160 |
| - FormatStereo441008bLE = &Format{ |
161 |
| - NumChannels: 2, |
162 |
| - SampleRate: 44100, |
163 |
| - BitDepth: 8, |
164 |
| - Endianness: binary.LittleEndian, |
165 |
| - } |
166 |
| - // FormatStereo4410016bLE Stereo 16bit 44.1kHz WAV like format. |
167 |
| - FormatStereo4410016bLE = &Format{ |
168 |
| - NumChannels: 2, |
169 |
| - SampleRate: 44100, |
170 |
| - BitDepth: 16, |
171 |
| - Endianness: binary.LittleEndian, |
172 |
| - } |
173 |
| - // FormatStereo4410024bLE Stereo 24bit 44.1kHz WAV like format. |
174 |
| - FormatStereo4410024bLE = &Format{ |
175 |
| - NumChannels: 2, |
176 |
| - SampleRate: 44100, |
177 |
| - BitDepth: 24, |
178 |
| - Endianness: binary.LittleEndian, |
179 |
| - } |
180 |
| - // FormatStereo4410032bLE Stereo 32bit 44.1kHz WAV like format. |
181 |
| - FormatStereo4410032bLE = &Format{ |
182 |
| - NumChannels: 2, |
183 |
| - SampleRate: 44100, |
184 |
| - BitDepth: 32, |
185 |
| - Endianness: binary.LittleEndian, |
| 47 | + SampleRate: 96000, |
186 | 48 | }
|
187 | 49 | )
|
0 commit comments