bastibe / python-soundfile

SoundFile is an audio library based on libsndfile, CFFI, and NumPy
BSD 3-Clause "New" or "Revised" License
718 stars 111 forks source link

How to save left and right channel in separate files? #429

Open iCUE-Solutions opened 8 months ago

iCUE-Solutions commented 8 months ago

Is there a way to save the left and right channel of a recording into separate files? I'm currently splitting the wav files after but given how comprehensive the soundfile lib is, I feel it might be there already.

Any help in this matter is really appreciated.

bastibe commented 8 months ago

You get a frames x channels numpy array, so just index into that (audio[:, 0] for the first channel).