WAV file
(h, f)
| 164 | |
| 165 | |
| 166 | def test_wav(h, f): |
| 167 | """WAV file""" |
| 168 | import wave |
| 169 | # 'RIFF' <len> 'WAVE' 'fmt ' <len> |
| 170 | if not h.startswith(b'RIFF') or h[8:12] != b'WAVE' or h[12:16] != b'fmt ': |
| 171 | return None |
| 172 | f.seek(0) |
| 173 | try: |
| 174 | w = wave.open(f, 'r') |
| 175 | except (EOFError, wave.Error): |
| 176 | return None |
| 177 | return ('wav', w.getframerate(), w.getnchannels(), |
| 178 | w.getnframes(), 8*w.getsampwidth()) |
| 179 | |
| 180 | tests.append(test_wav) |
| 181 |
nothing calls this directly
no test coverage detected