Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
quazgar
flow3r firmware
Commits
f027625e
Commit
f027625e
authored
1 year ago
by
pippin
Browse files
Options
Downloads
Patches
Plain Diff
st3m_media: apply volume during pcm queing rather than audio task callback
parent
f347bd8a
No related branches found
No related tags found
No related merge requests found
Pipeline
#8799
failed
1 year ago
Stage: check
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/st3m/st3m_media.c
+17
-14
17 additions, 14 deletions
components/st3m/st3m_media.c
with
17 additions
and
14 deletions
components/st3m/st3m_media.c
+
17
−
14
View file @
f027625e
...
...
@@ -111,6 +111,7 @@ void st3m_media_pcm_queue_s16(int hz, int ch, int count, int16_t *data) {
}
void
st3m_media_pcm_queue_float
(
int
hz
,
int
ch
,
int
count
,
float
*
data
)
{
if
(
!
audio_media
)
return
;
int16_t
gain
=
audio_media
->
volume
;
switch
(
hz
)
{
case
48000
:
if
(
ch
==
2
)
...
...
@@ -131,9 +132,11 @@ void st3m_media_pcm_queue_float(int hz, int ch, int count, float *data) {
if
(
ch
==
2
)
{
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
again2:
audio_buffer
[
audio_w
++
]
=
apply_gain
(
data
[
i
*
2
]
*
32767
,
gain
);
audio_buffer
[
audio_w
++
]
=
apply_gain
(
data
[
i
*
2
]
*
32767
,
gain
);
ST3M_PCM_CLAMP_AUDIO_W
;
audio_buffer
[
audio_w
++
]
=
apply_gain
(
data
[
i
*
2
+
1
]
*
32767
,
gain
);
audio_buffer
[
audio_w
++
]
=
apply_gain
(
data
[
i
*
2
+
1
]
*
32767
,
gain
);
ST3M_PCM_CLAMP_AUDIO_W
;
phase
+=
fraction
;
if
(
phase
>
65536
)
{
...
...
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