AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::mediaPlayer::Normalizer Class Reference

#include <Normalizer.h>

Public Member Functions

bool normalize (const double &unnormalizedInput, double *normalizedOutput)

Static Public Member Functions

static std::unique_ptr< Normalizercreate (const double &sourceMin, const double &sourceMax, const double &normalizedMin, const double &normalizedMax)

Detailed Description

This class performs a linear transform between two ranges [sourceMin, sourceMax] -> [normalizedMin, normalizedMax]. This is used by the MediaPlayer to convert between different volume ranges. MediaPlayer internally uses GStreamer, whose volume element takes in a gdouble.

Member Function Documentation

◆ create()

std::unique_ptr< Normalizer > alexaClientSDK::mediaPlayer::Normalizer::create ( const double &  sourceMin,
const double &  sourceMax,
const double &  normalizedMin,
const double &  normalizedMax 

Creates a unique_ptr to a Normalizer class.

sourceMinThe minimum value in the source space.
sourceMaxThe maximum value in the source space.
normalizedMinThe minimum value in the normalized space.
normalizedMaxThe maximum value in the normalized space.
A pointer to an instance of the Normalizer class if the ranges are valid. Otherwise, nullptr is returned.

◆ normalize()

bool alexaClientSDK::mediaPlayer::Normalizer::normalize ( const double &  unnormalizedInput,
double *  normalizedOutput 

Performs feature scaling from [srcMin, srcMax] to [normalizedMin, normalizedMax].

unnormalizedInputThe input value to normalize.
[out]normalizedOutputThe result after normalization.
Whether the operation was successful.

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

AlexaClientSDK 1.26.0 - Copyright 2016-2021, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0