diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/frame.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h index fc3481136..3f1543028 100644 --- a/include/asterisk/frame.h +++ b/include/asterisk/frame.h @@ -569,6 +569,17 @@ int ast_frame_adjust_volume(struct ast_frame *f, int adjustment); */ int ast_frame_slinear_sum(struct ast_frame *f1, struct ast_frame *f2); +/*! + * \brief Get the sample rate for a given format. + */ +static force_inline int ast_format_rate(int format) +{ + if (format == AST_FORMAT_G722) + return 16000; + + return 8000; +} + #if defined(__cplusplus) || defined(c_plusplus) } #endif |