Skip to content
Discussion options

You must be logged in to vote

@schittli - That's an interesting usecase that I didn't think of. I had to do some digging to find a workaround, and luckily there is an anull filter, which does nothing but just pass the input samples to output. With it, you can use the filter function.

Here is a quick example:

import ffmpegio as ff
import numpy as np
from matplotlib import pyplot as plt

fs = 16000
T = 1
x = np.random.default_rng().integers(2^-15,2^15,dtype='int16',size=(T*fs,2))

fsout,y = ff.audio.filter('anull', fs, x, ac=1) # no explicit filtering, just implicit stereo->mono conversion

plt.plot(x)
plt.plot(y)
plt.show()

Let me know if this works for you

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@schittli
Comment options

@tikuma-lsuhsc
Comment options

@SohamTilekar
Comment options

@tikuma-lsuhsc
Comment options

Answer selected by schittli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants