AlexaClientSDK  3.0.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()

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

Creates a unique_ptr to a Normalizer class.

Parameters
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.
Returns
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].

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

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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0