MCPcopy Create free account
hub / github.com/dmlc/decord / test_bytes_io

Function test_bytes_io

tests/python/unittests/test_audio_reader.py:32–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 assert_raises(DECORDError, AudioReader, os.path.join(os.path.dirname(__file__), '..', '..', 'test_data', 'video_0.mov'), CTX)
31
32def test_bytes_io():
33 fn = os.path.join(os.path.dirname(__file__), '..', '..', 'cpp', 'audio', 'count_down.mov')
34 with open(fn, 'rb') as f:
35 ar = AudioReader(f)
36 assert ar.shape() == (1, 482240)
37 ar2 = get_single_channel_reader()
38 assert np.allclose(ar[10].asnumpy(), ar2[10].asnumpy())
39
40def test_resample():
41 ar = get_resampled_reader()

Callers

nothing calls this directly

Calls 4

shapeMethod · 0.95
AudioReaderClass · 0.90
asnumpyMethod · 0.80

Tested by

no test coverage detected