mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
audio-src: add volume
This commit is contained in:
parent
f8c2038663
commit
6025b30a46
1 changed files with 2 additions and 1 deletions
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#define DEFAULT_RATE 44100
|
#define DEFAULT_RATE 44100
|
||||||
#define DEFAULT_CHANNELS 2
|
#define DEFAULT_CHANNELS 2
|
||||||
|
#define DEFAULT_VOLUME 0.7
|
||||||
|
|
||||||
struct type {
|
struct type {
|
||||||
struct spa_type_media_type media_type;
|
struct spa_type_media_type media_type;
|
||||||
|
|
@ -76,7 +77,7 @@ static void fill_f32(struct data *d, void *dest, int avail)
|
||||||
if (d->accumulator >= M_PI_M2)
|
if (d->accumulator >= M_PI_M2)
|
||||||
d->accumulator -= M_PI_M2;
|
d->accumulator -= M_PI_M2;
|
||||||
|
|
||||||
val = sin(d->accumulator);
|
val = sin(d->accumulator) * DEFAULT_VOLUME;
|
||||||
for (c = 0; c < DEFAULT_CHANNELS; c++)
|
for (c = 0; c < DEFAULT_CHANNELS; c++)
|
||||||
*dst++ = val;
|
*dst++ = val;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue