Arduino A2DP

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
A2DPNoVolumeControl Class Reference

Keeps the audio data as is -> no volume control! More...

`#include <A2DPVolumeControl.h>`

Inheritance diagram for A2DPNoVolumeControl:

## Public Member Functions
| A2DPNoVolumeControl (int32_t fixedVolume=0x1000)
| Constructor with optional fixed volume setting.
int32_t | get_volume_factor ()
| Gets the current volume factor.
int32_t | get_volume_factor_max ()
| Gets the maximum volume factor value.
void | set_enabled (bool enabled)
| Enables or disables volume control.
void | set_mono_downmix (bool enabled)
| Enables or disables mono downmix.
void | set_volume (uint8_t volume) override
| Override that does nothing - no volume setting.
void | update_audio_data (Frame *data, uint16_t frameCount) override
| Override that does nothing - no audio data modification.
virtual void | update_audio_data (uint8_t *data, uint16_t byteCount)
| Updates audio data with volume control and optional mono downmix.

## Protected Member Functions
int32_t | clip (int32_t value)
| Clips audio sample value to prevent overflow.

## Protected Attributes
bool | is_volume_used = false
| Flag indicating if volume control is enabled.
bool | mono_downmix = false
| Flag indicating if mono downmix is enabled.
int32_t | volumeFactor = 1
| Current volume factor.
int32_t | volumeFactorClippingLimit = 0xfff
| Volume factor clipping limit (4095)
int32_t | volumeFactorMax = 0x1000
| Maximum volume factor (4096)

## Detailed Description

Keeps the audio data as is -> no volume control!

Author
  pschatzmann

Copyright
  Apache License Version 2

## Constructor & Destructor Documentation

## ◆ A2DPNoVolumeControl()

A2DPNoVolumeControl::A2DPNoVolumeControl | ( | int32_t | fixedVolume = `0x1000` | ) |
| inline

Constructor with optional fixed volume setting.

Parameters

  fixedVolume | Fixed volume factor (default: 0x1000/4096 for no change) If different from 0x1000, volume control will be enabled with this fixed value

## Member Function Documentation

## ◆ clip()

int32_t A2DPVolumeControl::clip | ( | int32_t | value | ) |
| inline protected inherited

Clips audio sample value to prevent overflow.

Parameters

  value | Input audio sample value

Returns
  Clipped value within valid 16-bit range (-32768 to 32767)

## ◆ get_volume_factor()

int32_t A2DPVolumeControl::get_volume_factor | ( |  | ) |
| inline inherited

Gets the current volume factor.

Returns
  Volume factor in the range of 0 to 4096

## ◆ get_volume_factor_max()

int32_t A2DPVolumeControl::get_volume_factor_max | ( |  | ) |
| inline inherited

Gets the maximum volume factor value.

Returns
  Maximum factor value (4096)

## ◆ set_enabled()

void A2DPVolumeControl::set_enabled | ( | bool | enabled | ) |
| inline inherited

Enables or disables volume control.

Parameters

  enabled | True to enable volume control, false to disable

## ◆ set_mono_downmix()

void A2DPVolumeControl::set_mono_downmix | ( | bool | enabled | ) |
| inline inherited

Enables or disables mono downmix.

Parameters

  enabled | True to enable mono downmix, false to disable

## ◆ set_volume()

void A2DPNoVolumeControl::set_volume | ( | uint8_t | volume | ) |
| inline override virtual

Override that does nothing - no volume setting.

Parameters

  volume | Volume level (unused)

Implements A2DPVolumeControl.

## ◆ update_audio_data() [1/2]

void A2DPNoVolumeControl::update_audio_data | ( | Frame * | data,
|  | uint16_t | frameCount
| ) |  |
| inline override virtual

Override that does nothing - no audio data modification.

Parameters

  data | Pointer to audio frame data (unused)
  frameCount | Number of frames (unused)

Reimplemented from A2DPVolumeControl.

## ◆ update_audio_data() [2/2]

virtual void A2DPVolumeControl::update_audio_data | ( | uint8_t * | data,
|  | uint16_t | byteCount
| ) |  |
| inline virtual inherited

Updates audio data with volume control and optional mono downmix.

Parameters

  data | Pointer to raw audio data (uint8_t)
  byteCount | Number of bytes to process

The documentation for this class was generated from the following file:

- src/A2DPVolumeControl.h