Discussion:
Sampling rate
Niko Efthymiou
2014-03-29 12:12:21 UTC
Permalink
Hi,

is there a way to specify the sampling rate of the input for an OP?


Niko
Gregory Petrosyan
2014-03-29 13:54:44 UTC
Permalink
Post by Niko Efthymiou
is there a way to specify the sampling rate of the input for an OP?
`_open` callback of the OP has an `sample_format_t` argument, which
contains sampling rate information (use `sf_get_rate` to get it).

Gregory
Niko Efthymiou
2014-03-29 14:50:42 UTC
Permalink
Post by Gregory Petrosyan
Post by Niko Efthymiou
is there a way to specify the sampling rate of the input for an OP?
`_open` callback of the OP has an `sample_format_t` argument, which
contains sampling rate information (use `sf_get_rate` to get it).
Well that only gives me the sampling rate my input is in. My question
was if I can specify what kind of input I want.

Anyway, I just added resampling for the jack OP with libsamplerate.

Would there be a benefit of doing the resampling and format mangling in
the player? Alsa without plughw or anything?

Niko
Gregory Petrosyan
2014-03-30 08:17:19 UTC
Permalink
Post by Niko Efthymiou
Post by Gregory Petrosyan
Post by Niko Efthymiou
is there a way to specify the sampling rate of the input for an OP?
`_open` callback of the OP has an `sample_format_t` argument, which
contains sampling rate information (use `sf_get_rate` to get it).
Well that only gives me the sampling rate my input is in. My question
was if I can specify what kind of input I want.
Ah, I understand you now. No — cmus has no built-in general purpose resampling.
Post by Niko Efthymiou
Anyway, I just added resampling for the jack OP with libsamplerate.
Would there be a benefit of doing the resampling and format mangling in
the player? Alsa without plughw or anything?
My quick googling tells me that jackd does not resample audio.
Resampling in the player seems to be the only option then.

As for resampling for other output plugins, I do not remember people
complaining about lack of builtin resampling in cmus. I think we can
leave that as is for now.

Gregory

Loading...