Bandpass filter for audio wav file

How do I apply a bandpass filter on an audio file which is in wav format? And write back the filtered data in a new wav file for further analysis.

• What have you tried? What tutorials/books/online resources have you read? This is a pretty basic task that is well documented. – MBaz Apr 10 at 17:26
• So I've looked/tried/read ThinkDSP by AllenDowney but it relies heavily on the thinkDSP library. I want a more robust solution. I have a matlab code that works wonderfully. I want to implement it in python as well. – PhoenixProject Apr 10 at 19:22
• Try this, they discussed similar topic to yours – user41623 Apr 11 at 6:41

Consider looking at this StackOverflow answer which provides the full code for creating a Butterworth bandpass filter. In the sample code the answerer provides, the filter is applied to a manually constructed simplistic signal x. If you substitute this signal with your own NumPy array, it should achieve the intended effect.
WAV files can be quickly made into NumPy arrays, consider using the librosa module. librosa.core.load will be what you use. To write out the filtered signal, simply use librosa.output.write_wav.