(data)
| 256 | return numpy.sin(2 * numpy.pi * 440 * numpy.linspace(0, 1, 44100)) * scale |
| 257 | |
| 258 | def read_wav(data): |
| 259 | with wave.open(BytesIO(data)) as wave_file: |
| 260 | wave_data = wave_file.readframes(wave_file.getnframes()) |
| 261 | num_samples = wave_file.getnframes() * wave_file.getnchannels() |
| 262 | return struct.unpack('<%sh' % num_samples, wave_data) |
| 263 | |
| 264 | def test_code_from_file(): |
| 265 | c = display.Code(filename=__file__) |
no outgoing calls
no test coverage detected