AIFC and AIFF files
(h, f)
| 77 | tests = [] |
| 78 | |
| 79 | def 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 | |
| 100 | tests.append(test_aifc) |
| 101 |
nothing calls this directly
no test coverage detected