Skip to content

A thought about volume control #197

Description

@Frank-Bemelman

Depending how the VS1053 is used with an amplifier or headphones, volume can be controlled by sending volume levels to the VS1053 or let it stay at the default level of 95 (VS1053_INITIALVOLUME 95).

Nothing wrong with that, if you control the volume yourself on an external amplifier.

If you have your own amplifier board, with a fixed input level, or maybe use the earphone output jack, you can control the volume by manipulating stream.setVolume(volume);.

The range of the volume is 0-100. That translates to a range of -128dB (lowest value) to 0dB (loudest).

An audio range of 128dB is insane. Regular audio sytems have a practical volume range between 40db or max 60db.

Since the VS1053, with steps in 0.5 db, is already logarithmic, which is good. The volume value send with stream.setVolume(volume) work in steps of ~ 1.28 dB. which also allows for fine adjustment. But you will notice, the values below 60 are pretty useless, almost no sound is heard.

A more sensible volume control would send values to the VS1053 between 60-100, and a zero for absolute silence.

If we map our desired volume level of 0-100 to 60-100 you get a much more sensible control. A final value of 60 is roughly -51db and in the sweet spot of the range of commercial hifi systems as we know them.

void SetVolumeMapped(uint16_t volume)
{ 
    if(volume)stream.setVolume(map(volume, 0, 100, 60, 100)); 
    else stream.setVolume(0);
}

This can be done easily in the user code. Try it if you like it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions