Lines Matching refs:aifc
9 import aifc
14 module = aifc
106 sndfilename = 'pluck-ulaw.aifc'
129 #This file contains chunk types aifc doesn't recognize.
130 self.f = aifc.open(findfile('Sine-1000Hz-300ms.aif'))
133 fout = aifc.open(io.BytesIO(), 'wb')
142 fout = self.fout = aifc.open(TESTFN, 'wb')
149 f = self.f = aifc.open(TESTFN, 'rb')
153 self.assertRaises(aifc.Error, f.getmark, 3)
161 getattr(aifc, '_write_' + what)(f, x)
163 return getattr(aifc, '_read_' + what)(f)
167 self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL)
181 self.assertRaises(EOFError, aifc._read_ulong, f)
182 self.assertRaises(EOFError, aifc._read_long, f)
183 self.assertRaises(EOFError, aifc._read_ushort, f)
184 self.assertRaises(EOFError, aifc._read_short, f)
189 aifc._write_string(f, 'too long' * 255)
192 with self.assertRaises(aifc.Error):
193 aifc.open(TESTFN, 'wrong_mode')
198 self.assertRaises(aifc.Error, aifc.open, b1)
199 self.assertRaises(aifc.Error, aifc.open, b2)
203 self.assertRaises(aifc.Error, aifc.open, b)
206 b = 'FORM' + struct.pack('>L', 4) + 'AIFC'
209 self.assertRaises(aifc.Error, aifc.open, io.BytesIO(b))
217 f = aifc.open(io.BytesIO(b))
223 b = 'FORM' + struct.pack('>L', 4) + 'AIFC'
228 f = aifc.open(io.BytesIO(b))
233 b = 'FORM' + struct.pack('>L', 4) + 'AIFC'
238 f = aifc.open(io.BytesIO(b))
243 fout = aifc.open(io.BytesIO(), 'wb')
245 self.assertRaises(aifc.Error, fout.setparams, wrong_params)
246 self.assertRaises(aifc.Error, fout.getparams)
247 self.assertRaises(aifc.Error, fout.setnchannels, 0)
248 self.assertRaises(aifc.Error, fout.getnchannels)
249 self.assertRaises(aifc.Error, fout.setsampwidth, 0)
250 self.assertRaises(aifc.Error, fout.getsampwidth)
251 self.assertRaises(aifc.Error, fout.setframerate, 0)
252 self.assertRaises(aifc.Error, fout.getframerate)
253 self.assertRaises(aifc.Error, fout.setcomptype, 'WRNG', '')
260 self.assertRaises(aifc.Error, fout.setparams, (1, 1, 1, 1, 1, 1))
261 self.assertRaises(aifc.Error, fout.setnchannels, 1)
262 self.assertRaises(aifc.Error, fout.setsampwidth, 1)
263 self.assertRaises(aifc.Error, fout.setframerate, 1)
264 self.assertRaises(aifc.Error, fout.setnframes, 1)
265 self.assertRaises(aifc.Error, fout.setcomptype, 'NONE', '')
266 self.assertRaises(aifc.Error, fout.aiff)
267 self.assertRaises(aifc.Error, fout.aifc)
270 fout = aifc.open(io.BytesIO(), 'wb')
271 fout.aifc()
289 fout = aifc.open(io.BytesIO(), 'wb')
290 fout.aifc()
297 fout = aifc.open(io.BytesIO(), 'wb')
298 self.assertRaises(aifc.Error, fout.close)
299 fout = aifc.open(io.BytesIO(), 'wb')
301 self.assertRaises(aifc.Error, fout.close)
302 fout = aifc.open(io.BytesIO(), 'wb')
305 self.assertRaises(aifc.Error, fout.close)
309 fout = aifc.open(io.BytesIO(), 'wb')
312 self.assertRaises(aifc.Error, fout.close)
316 fout = aifc.open(io.BytesIO(), 'wb')
317 self.assertRaises(aifc.Error, fout.setmark, 0, 0, '')
318 self.assertRaises(aifc.Error, fout.setmark, 1, -1, '')
319 self.assertRaises(aifc.Error, fout.setmark, 1, 0, None)
320 self.assertRaises(aifc.Error, fout.getmark, 1)
328 fout = self.fout = aifc.open(filename, 'wb')
334 f = self.f = aifc.open(filename, 'rb')