@@ -32,42 +32,48 @@ msgid ""
32
32
"\" WAVE\" (or \" WAV\" ) file format. Only uncompressed PCM encoded wave files "
33
33
"are supported."
34
34
msgstr ""
35
+ ":mod:`wave` 模組為波形音訊檔案格式「WAVE」(或稱「WAV」)提供了便捷的介面。"
36
+ "僅支援未壓縮的 PCM 編碼波形檔。"
35
37
36
38
#: ../../library/wave.rst:20
37
39
msgid ""
38
40
"Support for ``WAVE_FORMAT_EXTENSIBLE`` headers was added, provided that the "
39
41
"extended format is ``KSDATAFORMAT_SUBTYPE_PCM``."
40
42
msgstr ""
43
+ "增加了標頭 ``WAVE_FORMAT_EXTENSIBLE`` 的支援,要求的擴展格式"
44
+ "為 ``KSDATAFORMAT_SUBTYPE_PCM``。"
41
45
42
46
#: ../../library/wave.rst:23
43
47
msgid "The :mod:`wave` module defines the following function and exception:"
44
- msgstr ""
48
+ msgstr ":mod:`wave` 模組定義了以下的函式和例外: "
45
49
46
50
#: ../../library/wave.rst:28
47
51
msgid ""
48
52
"If *file* is a string, open the file by that name, otherwise treat it as a "
49
53
"file-like object. *mode* can be:"
50
54
msgstr ""
55
+ "如果 *file* 是一個字串,會打開對應名稱的檔案,否則會以類檔案物件處理。"
56
+ "*mode* 可以是:"
51
57
52
58
#: ../../library/wave.rst:32
53
59
msgid "``'rb'``"
54
60
msgstr "``'rb'``"
55
61
56
62
#: ../../library/wave.rst:32
57
63
msgid "Read only mode."
58
- msgstr ""
64
+ msgstr "唯讀模式。 "
59
65
60
66
#: ../../library/wave.rst:35
61
67
msgid "``'wb'``"
62
68
msgstr "``'wb'``"
63
69
64
70
#: ../../library/wave.rst:35
65
71
msgid "Write only mode."
66
- msgstr ""
72
+ msgstr "唯寫模式。 "
67
73
68
74
#: ../../library/wave.rst:37
69
75
msgid "Note that it does not allow read/write WAV files."
70
- msgstr ""
76
+ msgstr "請注意,不支援同時讀寫 WAV 檔案。 "
71
77
72
78
#: ../../library/wave.rst:39
73
79
msgid ""
@@ -76,131 +82,145 @@ msgid ""
76
82
"file-like object is passed as *file*, ``file.mode`` is used as the default "
77
83
"value for *mode*."
78
84
msgstr ""
85
+ "*mode* 設定為 ``'rb'`` 時,會回傳一個 :class:`Wave_read` 物件,*mode* 設定為 "
86
+ "``'wb'`` 時,則回傳一個 :class:`Wave_write` 物件。如果省略 *mode*,並且將類檔案"
87
+ " (file-like) 物件作為 *file* 參數傳遞,則 ``file.mode`` 會是 *mode* 的預設值。"
79
88
80
89
#: ../../library/wave.rst:44
81
90
msgid ""
82
91
"If you pass in a file-like object, the wave object will not close it when "
83
92
"its ``close()`` method is called; it is the caller's responsibility to close "
84
93
"the file object."
85
94
msgstr ""
95
+ "如果您傳遞一個類檔案物件,當呼叫其 ``close()`` 方法時,wave 物件不會自動關閉"
96
+ "該物件;關閉檔案物件的責任會在呼叫者上。"
86
97
87
98
#: ../../library/wave.rst:48
88
99
msgid ""
89
100
"The :func:`.open` function may be used in a :keyword:`with` statement. When "
90
101
"the :keyword:`!with` block completes, the :meth:`Wave_read.close()` or :meth:"
91
102
"`Wave_write.close()` method is called."
92
103
msgstr ""
104
+ ":func:`.open` 函式可以在 :keyword:`with` 陳述式中使用。當 :keyword:`!with` 區"
105
+ "塊完成時,會呼叫 :meth:`Wave_read.close()` 或是 :meth:`Wave_write.close()` 方"
106
+ "法。"
93
107
94
108
#: ../../library/wave.rst:52 ../../library/wave.rst:176
95
109
msgid "Added support for unseekable files."
96
- msgstr ""
110
+ msgstr "增加對不可搜尋 (unseekable) 檔案的支援。 "
97
111
98
112
#: ../../library/wave.rst:57
99
113
msgid ""
100
114
"An error raised when something is impossible because it violates the WAV "
101
115
"specification or hits an implementation deficiency."
102
- msgstr ""
116
+ msgstr "當不符合 WAV 格式或無法操作時會引發錯誤。 "
103
117
104
118
#: ../../library/wave.rst:64
105
119
msgid "Wave_read Objects"
106
120
msgstr "Wave_read 物件"
107
121
108
122
#: ../../library/wave.rst:68
109
123
msgid "Read a WAV file."
110
- msgstr ""
124
+ msgstr "讀取一個 WAV 檔案。 "
111
125
112
126
#: ../../library/wave.rst:70
113
127
msgid ""
114
128
"Wave_read objects, as returned by :func:`.open`, have the following methods:"
115
- msgstr ""
129
+ msgstr "由 :func:`.open` 回傳的 Wave_read 物件具有以下方法: "
116
130
117
131
#: ../../library/wave.rst:75
118
132
msgid ""
119
133
"Close the stream if it was opened by :mod:`wave`, and make the instance "
120
134
"unusable. This is called automatically on object collection."
121
- msgstr ""
135
+ msgstr "關閉 :mod:`wave` 開啟的串流並使該實例無法使用。當物件回收時自動呼叫。 "
122
136
123
137
#: ../../library/wave.rst:81
124
138
msgid "Returns number of audio channels (``1`` for mono, ``2`` for stereo)."
125
- msgstr ""
139
+ msgstr "回傳音訊聲道的數量(單聲道為 ``1``,立體聲為 ``2``)。 "
126
140
127
141
#: ../../library/wave.rst:86
128
142
msgid "Returns sample width in bytes."
129
- msgstr ""
143
+ msgstr "回傳以位元組表示的取樣寬度 (sample width)。 "
130
144
131
145
#: ../../library/wave.rst:91
132
146
msgid "Returns sampling frequency."
133
- msgstr ""
147
+ msgstr "回傳取樣率。 "
134
148
135
149
#: ../../library/wave.rst:96
136
150
msgid "Returns number of audio frames."
137
- msgstr ""
151
+ msgstr "回傳音訊幀數。 "
138
152
139
153
#: ../../library/wave.rst:101
140
154
msgid "Returns compression type (``'NONE'`` is the only supported type)."
141
- msgstr ""
155
+ msgstr "回傳壓縮類型(僅支援 ``'NONE'`` 類型)。 "
142
156
143
157
#: ../../library/wave.rst:106
144
158
msgid ""
145
159
"Human-readable version of :meth:`getcomptype`. Usually ``'not compressed'`` "
146
160
"parallels ``'NONE'``."
147
161
msgstr ""
162
+ ":meth:`getcomptype` 的人類可讀的版本。通常使用 ``'not compressed'`` 代替 "
163
+ "``'NONE'``。"
148
164
149
165
#: ../../library/wave.rst:112
150
166
msgid ""
151
167
"Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, "
152
168
"framerate, nframes, comptype, compname)``, equivalent to output of the "
153
169
"``get*()`` methods."
154
170
msgstr ""
171
+ "回傳一個 :func:`~collections.namedtuple` ``(nchannels, sampwidth, framerate, "
172
+ "nframes, comptype, compname)``,等同於 ``get*()`` 方法的輸出。"
155
173
156
174
#: ../../library/wave.rst:119
157
175
msgid ""
158
176
"Reads and returns at most *n* frames of audio, as a :class:`bytes` object."
159
- msgstr ""
177
+ msgstr "讀取並回傳以 :class:`bytes` 物件表示的最多 *n* 個音訊幀。 "
160
178
161
179
#: ../../library/wave.rst:124
162
180
msgid "Rewind the file pointer to the beginning of the audio stream."
163
- msgstr ""
181
+ msgstr "重置檔案指標至音訊流的開頭。 "
164
182
165
183
#: ../../library/wave.rst:126
166
184
msgid ""
167
185
"The following two methods are defined for compatibility with the :mod:`aifc` "
168
186
"module, and don't do anything interesting."
169
- msgstr ""
187
+ msgstr "以下兩個方法是為了與 :mod:`aifc` 模組的保持相容性,並不執行任何操作。 "
170
188
171
189
#: ../../library/wave.rst:132
172
190
msgid "Returns ``None``."
173
- msgstr ""
191
+ msgstr "回傳 ``None``。 "
174
192
175
193
#: ../../library/wave.rst:137
176
194
msgid "Raise an error."
177
- msgstr ""
195
+ msgstr "引發錯誤。 "
178
196
179
197
#: ../../library/wave.rst:139
180
198
msgid ""
181
199
"The following two methods define a term \" position\" which is compatible "
182
200
"between them, and is otherwise implementation dependent."
183
201
msgstr ""
202
+ "以下兩個方法所定義的「位置」,在它們之間是相容的,但其他情況下則取決於具體實作"
203
+ "方式。"
184
204
185
205
#: ../../library/wave.rst:145
186
206
msgid "Set the file pointer to the specified position."
187
- msgstr ""
207
+ msgstr "將檔案指標設定為指定的位置。 "
188
208
189
209
#: ../../library/wave.rst:150
190
210
msgid "Return current file pointer position."
191
- msgstr ""
211
+ msgstr "回傳目前的檔案指標位置。 "
192
212
193
213
#: ../../library/wave.rst:156
194
214
msgid "Wave_write Objects"
195
215
msgstr "Wave_write 物件"
196
216
197
217
#: ../../library/wave.rst:160
198
218
msgid "Write a WAV file."
199
- msgstr ""
219
+ msgstr "寫入一個 WAV 檔案。 "
200
220
201
221
#: ../../library/wave.rst:162
202
222
msgid "Wave_write objects, as returned by :func:`.open`."
203
- msgstr ""
223
+ msgstr "Wave_write 物件,由 :func:`.open` 回傳。 "
204
224
205
225
#: ../../library/wave.rst:164
206
226
msgid ""
@@ -215,10 +235,17 @@ msgid ""
215
235
"`writeframes` will calculate the number of frames in the data and set "
216
236
"*nframes* accordingly before writing the frame data."
217
237
msgstr ""
238
+ "對於可搜尋 (seekable) 的輸出串流,``wave`` 標頭將自動更新,以反映實際寫入的幀"
239
+ "數。對於不可搜尋的串流,當寫入第一個幀資料時,*nframes* 的值必"
240
+ "須是準確的。要取得準確的 *nframes* 值,可以通過呼叫 :meth:`setnframes` 或 :"
241
+ "meth:`setparams` 方法,並在呼叫 :meth:`close` 之前設定將寫入的幀數量,然後使"
242
+ "用 :meth:`writeframesraw` 方法寫入幀資料;或者通過呼叫 :meth:`writeframes` 方"
243
+ "法一次性寫入所有的幀資料。在後一種情況下,:meth:`writeframes` 方法將計算資料"
244
+ "中的幀數量,並在寫入幀資料之前相應地設定 *nframes* 的值。"
218
245
219
246
#: ../../library/wave.rst:179
220
247
msgid "Wave_write objects have the following methods:"
221
- msgstr ""
248
+ msgstr "Wave_write 物件具有以下方法: "
222
249
223
250
#: ../../library/wave.rst:183
224
251
msgid ""
@@ -227,56 +254,65 @@ msgid ""
227
254
"exception if the output stream is not seekable and *nframes* does not match "
228
255
"the number of frames actually written."
229
256
msgstr ""
257
+ "確保 *nframes* 正確,如果該檔案是由 :mod:`wave` 開啟的,則關閉該檔案。此方法"
258
+ "在物件回收時被呼叫。如果輸出串流不可搜尋且 *nframes* 不符合實際"
259
+ "寫入的幀數,則會引發例外。"
230
260
231
261
#: ../../library/wave.rst:191
232
262
msgid "Set the number of channels."
233
- msgstr ""
263
+ msgstr "設定音訊的通道數量。 "
234
264
235
265
#: ../../library/wave.rst:196
236
266
msgid "Set the sample width to *n* bytes."
237
- msgstr ""
267
+ msgstr "設定取樣寬度為 *n* 個位元組。 "
238
268
239
269
#: ../../library/wave.rst:201
240
270
msgid "Set the frame rate to *n*."
241
- msgstr ""
271
+ msgstr "設定取樣頻率為 *n*。 "
242
272
243
273
#: ../../library/wave.rst:203
244
274
msgid "A non-integral input to this method is rounded to the nearest integer."
245
- msgstr ""
275
+ msgstr "此方法的非整數輸入會被將四捨五入到最接近的整數。 "
246
276
247
277
#: ../../library/wave.rst:210
248
278
msgid ""
249
279
"Set the number of frames to *n*. This will be changed later if the number "
250
280
"of frames actually written is different (this update attempt will raise an "
251
281
"error if the output stream is not seekable)."
252
282
msgstr ""
283
+ "設定幀數為 *n*。如果實際寫入的幀數不同,則稍後將進行更改(如果輸出串流不可搜"
284
+ "尋,則此嘗試將引發錯誤)。"
253
285
254
286
#: ../../library/wave.rst:217
255
287
msgid ""
256
288
"Set the compression type and description. At the moment, only compression "
257
289
"type ``NONE`` is supported, meaning no compression."
258
- msgstr ""
290
+ msgstr "設定壓縮類型和描述。目前只支援壓縮類型為 ``NONE``,表示無壓縮。 "
259
291
260
292
#: ../../library/wave.rst:223
261
293
msgid ""
262
294
"The *tuple* should be ``(nchannels, sampwidth, framerate, nframes, comptype, "
263
295
"compname)``, with values valid for the ``set*()`` methods. Sets all "
264
296
"parameters."
265
297
msgstr ""
298
+ "這個 *tuple* 應該是 ``(nchannels, sampwidth, framerate, nframes, comptype, "
299
+ "compname)``,值需要是符合 ``set*()`` 方法的參數。設定所有參數。"
266
300
267
301
#: ../../library/wave.rst:230
268
302
msgid ""
269
303
"Return current position in the file, with the same disclaimer for the :meth:"
270
304
"`Wave_read.tell` and :meth:`Wave_read.setpos` methods."
271
305
msgstr ""
306
+ "回傳檔案中的指標位置,其指標位置含意與 :meth:`Wave_read.tell` 和 :meth:"
307
+ "`Wave_read.setpos` 是一致的。"
272
308
273
309
#: ../../library/wave.rst:236
274
310
msgid "Write audio frames, without correcting *nframes*."
275
- msgstr ""
311
+ msgstr "寫入音訊幀,不修正 *nframes*。 "
276
312
277
313
#: ../../library/wave.rst:238 ../../library/wave.rst:249
278
314
msgid "Any :term:`bytes-like object` is now accepted."
279
- msgstr ""
315
+ msgstr "現在可接受任何 :term:`bytes-like object`。 "
280
316
281
317
#: ../../library/wave.rst:244
282
318
msgid ""
@@ -285,10 +321,14 @@ msgid ""
285
321
"that have been written after *data* has been written does not match the "
286
322
"previously set value for *nframes*."
287
323
msgstr ""
324
+ "寫入音訊幀並確保 *nframes* 正確。如果輸出串流不可搜尋,並且在寫"
325
+ "入 *data* 後已寫入的總幀數與先前設定的 *nframes* 值不符,則會引發錯誤。"
288
326
289
327
#: ../../library/wave.rst:252
290
328
msgid ""
291
329
"Note that it is invalid to set any parameters after calling :meth:"
292
330
"`writeframes` or :meth:`writeframesraw`, and any attempt to do so will "
293
331
"raise :exc:`wave.Error`."
294
332
msgstr ""
333
+ "注意在呼叫 :meth:`writeframes` 或 :meth:`writeframesraw` 之後設置任何參數都是"
334
+ "無效的,任何嘗試這樣做的操作都會引發 :exc:`wave.Error`。"
0 commit comments