[asterisk-bugs] [Asterisk 0017267]: [patch] audiohook: translation to slinear 8khz regardless of samplerate

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Aug 19 08:05:52 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17267 
====================================================================== 
Reported By:                ssester
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17267
Category:                   Core/General
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
JIRA:                       SWP-1398 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 258676 
Request Review:              
====================================================================== 
Date Submitted:             2010-04-30 07:17 CDT
Last Modified:              2010-08-19 08:05 CDT
====================================================================== 
Summary:                    [patch] audiohook: translation to slinear 8khz
regardless of samplerate
Description: 
If an audiohook is attached to a channel that uses a codec with a
samplerate of 16khz (e.g. G722) the frames are always downgraded to 8khz
16bit signed linear. So if we have 16khz G722 with 320 samples, that will
be downgraded to 160 samples.

The expected behaviour would be to translate the frames to 16khz 16bit
signed linear (SLINEAR16) with 320 samples.
====================================================================== 

---------------------------------------------------------------------- 
 (0126137) ssester (reporter) - 2010-08-19 08:05
 https://issues.asterisk.org/view.php?id=17267#c126137 
---------------------------------------------------------------------- 
The two new diffs contain a proposed solution. To deal with the concern
from dvossel an audiohook now has to set a flag to be given SLINEAR16:
ast_set_flag(data->audiohook, AST_AUDIOHOOK_WANTS_SLINEAR16);
This way, older audiohook applications won't see any changes to the
audiohook API.

Tested with Asterisk 1.6.2.10 and only one audiohook (with and without
16khz audio).
Still no SLINEAR16 support for spy and whisper audiohooks, but this patch
shouldn't break them.
Also new in this patch: if there is one (or more) audiohook requesting
SLINEAR and one (ore more) audiohook requesting SLINEAR16, both audiohooks
get the requested format and the result will be combined into one SLINEAR16
frame before being transcoded back to the original format(untested). 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-08-19 08:05 ssester        Note Added: 0126137                          
======================================================================




More information about the asterisk-bugs mailing list