Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
534ed674
Commit
534ed674
authored
9 years ago
by
Mark Michelson
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "audiohook: Read the correct number of samples based on audiohook format." into 11
parents
525bbf7d
5606da75
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/audiohook.c
+10
-0
10 additions, 0 deletions
main/audiohook.c
with
10 additions
and
0 deletions
main/audiohook.c
+
10
−
0
View file @
534ed674
...
...
@@ -377,6 +377,16 @@ static struct ast_frame *audiohook_read_frame_helper(struct ast_audiohook *audio
audiohook_set_internal_rate
(
audiohook
,
ast_format_rate
(
format
),
1
);
}
/* If the sample rate of the requested format differs from that of the underlying audiohook
* sample rate determine how many samples we actually need to get from the audiohook. This
* needs to occur as the signed linear factory stores them at the rate of the audiohook.
* We do this by determining the duration of audio they've requested and then determining
* how many samples that would be in the audiohook format.
*/
if
(
ast_format_rate
(
format
)
!=
audiohook
->
hook_internal_samp_rate
)
{
samples
=
(
audiohook
->
hook_internal_samp_rate
/
1000
)
*
(
samples
/
(
ast_format_rate
(
format
)
/
1000
));
}
if
(
!
(
read_frame
=
(
direction
==
AST_AUDIOHOOK_DIRECTION_BOTH
?
audiohook_read_frame_both
(
audiohook
,
samples
,
read_reference
,
write_reference
)
:
audiohook_read_frame_single
(
audiohook
,
samples
,
direction
))))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment