python 3.x – Can I use simpleaudio (or any other non-windows dependent library) instead of pyaudio to convert a stream object into numpy audio data?

I’m trying to recreate a fast fourier transform of some audio data (copied from this tutorial: in order to analyze the frequency of the audio in a WAV file. The problem is that the example uses pyaudio, which I haven’t figured out how to install. It also seems that you need windows to install it, and I would like to use a platform agnostic alternative like simpleaudio.

The example creates an input stream like so:

stream = = form_1,rate = samp_rate,channels = chans, 
                input_device_index = dev_index,input = True, 

And opens the stream to record audio and process the data:

data = np.fromstring(,dtype=np.int16)

I tried to look up the documentation ( but it wasn’t very informative. What I can tell it reads an audio sample from the stream and converts the output to a string, which can then be read into a numpy array. What does this string output look like, and is there a way to do this with simpleaudio or another platform agnostic library? Ideally I would like to have the option of doing this using an input audio stream in real time, and also converting an mp3 or WAV file to the desired output for this audio processing.

Any help would be much appreciated.