mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-24 02:36:00 +00:00
Improve preamp handling
Setting the preamp to the mid point should have no effect.
This commit is contained in:
parent
48912634b1
commit
2252c8e944
1 changed files with 5 additions and 2 deletions
|
|
@ -194,9 +194,12 @@ export default class Media {
|
|||
this._gainNode.gain.value = volume / 100;
|
||||
}
|
||||
|
||||
// From 0-1
|
||||
// From 0 to 100
|
||||
// The input value here is 0-100 which is kinda wrong, since it represents -12db to 12db.
|
||||
// For now, 50 is 0db (no change).
|
||||
// For now we map the values 0-100 to 0.5-1.5
|
||||
setPreamp(value: number) {
|
||||
this._preamp.gain.value = value / 100;
|
||||
this._preamp.gain.value = 1 + (value - 50) / 100;
|
||||
}
|
||||
|
||||
// From -100 to 100
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue