[asterisk-dev] SLINEAR_FORMAT returning 16khz frames not 8khz

Russell Bryant russell at russellbryant.net
Tue Aug 13 10:44:48 CDT 2013


On Tue, Aug 13, 2013 at 9:51 AM, Ryan Conrad <rconrad54 at gmail.com> wrote:

> I am not sure if this is a bug or not, but in chan_console, the function
> console_write returns frames with 320 samples instead of 160 eventhough the
> channels writeformat, readformat, rawwriteformat, and rawreadformat are all
> set to SLINEAR and not SLINEAR16.
>

console_write doesn't return frames, but I'm assuming you're just talking
about the audio frames that get queued up to be read from the channel.


> Please help, what else should I set to have console_write be correct?  Or
> is this truly a bug?
>

I don't know what all you've changed to try to make it do what you want,
but it's more than just setting those fields on the ast_channel.

You would need to change this so that portaudio gets set up correctly:

https://github.com/russellb/asterisk/blob/685ab908534cd2f6f7e25b117974a82fe1a5229a/channels/chan_console.c#L86


Also look for everywhere you see AST_FORMAT_SLINEAR16.  The function
reading audio from portaudio and queueing it up on the channel is:

https://github.com/russellb/asterisk/blob/685ab908534cd2f6f7e25b117974a82fe1a5229a/channels/chan_console.c#L277
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130813/b900b6f9/attachment-0001.htm>


More information about the asterisk-dev mailing list