[asterisk-dev] Question about audiohook.c and re-sampling
Joshua Colp
jcolp at digium.com
Fri Jun 6 13:27:44 CDT 2014
Dennis Guse wrote:
> Hi,
Kia ora,
> at the moment I am working on app_jack, so that it is not limited to
> 8000Hz anymore. During the day I made some progress and found that for a
> G722 I only get slin in app_jack instead of the expected slin16 (or even
> higher).
> I looked further and found that audiohook.c defines the internal
> sampling rate used for each audio hook. The sampling rate is set to
> 8000Hz...
There is an initialization flag, AST_AUDIOHOOK_MANIPULATE_ALL_RATES, you
can set which will cause the code to provide signed linear in the sample
rate of the source codec. In the case of G722 this would be slin16.
> Due to a lack of documentation I am not quite sure how to change
> audiohook.c, so that always the channel's native sampling rate, which
> depends on the actual codec, is passed to app_jack.
Once enabling the above you would need to change app_jack to remove the
assumption that it will always be dealing with AST_FORMAT_SLINEAR.
Cheers,
--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org
More information about the asterisk-dev
mailing list