Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -38,10 +38,9 @@ class aubio_source_read_test_case(aubio_source_test_case_base): · 37 unmodified lines | |||
| 38 | vec, read = f() | 38 | vec, read = f() |
| 39 | total_frames += read | 39 | total_frames += read |
| 40 | if read < f.hop_size: break | 40 | if read < f.hop_size: break |
| 41 | print ("read", "%.2fs" % (total_frames / float(f.samplerate) ) ), | 41 | result_str = "read {:.2f}s ({:d} frames in {:d} blocks at {:d}Hz) from {:s}" |
| 42 | print ("(", total_frames, "frames", "in" ), | 42 | params = total_frames / float(f.samplerate), total_frames, int(total_frames/f.hop_size), f.samplerate, f.uri |
| 43 | print (total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")" ), | 43 | print (result_str.format(*params)) |
| 44 | print ("from", f.uri) | ||
| 45 | return total_frames | 44 | return total_frames |
| 46 | 45 | ||
| 47 | def test_samplerate_hopsize(self): | 46 | def test_samplerate_hopsize(self): |
| @@ -108,11 +107,9 @@ class aubio_source_readmulti_test_case(aubio_source_read_test_case): · 60 unmodified lines | |||
| 108 | vec, read = f.do_multi() | 107 | vec, read = f.do_multi() |
| 109 | total_frames += read | 108 | total_frames += read |
| 110 | if read < f.hop_size: break | 109 | if read < f.hop_size: break |
| 111 | print ("read", "%.2fs" % (total_frames / float(f.samplerate) ) ), | 110 | result_str = "read {:.2f}s ({:d} frames in {:d} channels and {:d} blocks at {:d}Hz) from {:s}" |
| 112 | print ("(", total_frames, "frames", "in" ), | 111 | params = total_frames / float(f.samplerate), total_frames, f.channels, int(total_frames/f.hop_size), f.samplerate, f.uri |
| 113 | print (f.channels, "channels and" ), | 112 | print (result_str.format(*params)) |
| 114 | print (total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")" ), | ||
| 115 | print ("from", f.uri) | ||
| 116 | return total_frames | 113 | return total_frames |
| 117 | 114 | ||
| 118 | if __name__ == '__main__': | 115 | if __name__ == '__main__': |