Simple snippets for audio analysis
Project description
audio-snippets
Install
pip install audio-snippets
Usage
I suggest you use jupyter notebooks to take full advantage of all functions
Load Audio
from audio_snippets import Sound
s = Sound.from_path('/path/to/audio/file.mp3')
Data
print(s.audio) # just the numpy array :D
print(s.Fs) # sampling frequency
Play it
s.play()
s.play(x=5) # play the audio in 5x speed
Size of audio
len(s) # Number of samples
s.size # Number of seconds of audio
s.formatted_size
# length of the audio in seconds/minutes/hours
# E.g. # 5.323 seconds ; 6.43 minutes ; 1.53 hours
Slice the audio
t = s[3:5] # Slices the audio from 3 to 5 seconds
t.play()
t = s[:5] # Slice first 5 seconds
t = s[5:] # Slice from 5 seconds onward
t = s[::2] # select every second sample (speeds the audio by 2x)
Plot the waveform
s.plot() # interactive plotly
s.plot(slice(5, 25)) # plot a slice of the waveform
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
audio_snippets-0.0.1.tar.gz
(11.7 kB
view hashes)
Built Distribution
Close
Hashes for audio_snippets-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a5ab66eab9205438a902d138f5289611ea630953160f9c84fd77877de608325 |
|
MD5 | ee4b0b5b2aaf455adc53ca01ad120425 |
|
BLAKE2b-256 | 5a594da7f0952ece220ffe354df2f9ce561b30f48eb9446f014e9a607cbece37 |