How to create a numpy array from a pydub AudioSegment?

Pydub has a facility for getting the audio data as an array of samples, it is an array.array instance (not a numpy array) but you should be able to convert it to a numpy array relatively easily: from pydub import AudioSegment sound = AudioSegment.from_file(“sound1.wav”) # this is an array samples = sound.get_array_of_samples() You may be … Read more