MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / test_aifc

Function test_aifc

tools/python-3.11.9-amd64/Lib/sndhdr.py:79–98  ·  view source on GitHub ↗

AIFC and AIFF files

(h, f)

Source from the content-addressed store, hash-verified

77tests = []
78
79def test_aifc(h, f):
80 """AIFC and AIFF files"""
81 with warnings.catch_warnings():
82 warnings.simplefilter('ignore', category=DeprecationWarning)
83 import aifc
84 if not h.startswith(b'FORM'):
85 return None
86 if h[8:12] == b'AIFC':
87 fmt = 'aifc'
88 elif h[8:12] == b'AIFF':
89 fmt = 'aiff'
90 else:
91 return None
92 f.seek(0)
93 try:
94 a = aifc.open(f, 'r')
95 except (EOFError, aifc.Error):
96 return None
97 return (fmt, a.getframerate(), a.getnchannels(),
98 a.getnframes(), 8 * a.getsampwidth())
99
100tests.append(test_aifc)
101

Callers

nothing calls this directly

Calls 7

startswithMethod · 0.80
seekMethod · 0.45
openMethod · 0.45
getframerateMethod · 0.45
getnchannelsMethod · 0.45
getnframesMethod · 0.45
getsampwidthMethod · 0.45

Tested by

no test coverage detected