Created
November 28, 2025 01:25
-
-
Save ntrrgc/c1dbbd193a7fd170f43ba4f9aeb13457 to your computer and use it in GitHub Desktop.
Compute maximum PCM sample (scipy)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import timeit | |
| import scipy.io.wavfile | |
| t0 = timeit.default_timer() | |
| _, samples = scipy.io.wavfile.read("test.wav") | |
| for channel_ix, max_sample in enumerate(samples.max(axis=0)): | |
| print(f"Channel {channel_ix} max: 0x{max_sample:x}") | |
| t1 = timeit.default_timer() | |
| print(f"Elapsed {(t1-t0)*1000:.3f}ms") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment