{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaConvert.Types.AudioCodecSettings
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.AudioCodecSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.AacSettings
import Amazonka.MediaConvert.Types.Ac3Settings
import Amazonka.MediaConvert.Types.AiffSettings
import Amazonka.MediaConvert.Types.AudioCodec
import Amazonka.MediaConvert.Types.Eac3AtmosSettings
import Amazonka.MediaConvert.Types.Eac3Settings
import Amazonka.MediaConvert.Types.Mp2Settings
import Amazonka.MediaConvert.Types.Mp3Settings
import Amazonka.MediaConvert.Types.OpusSettings
import Amazonka.MediaConvert.Types.VorbisSettings
import Amazonka.MediaConvert.Types.WavSettings
import qualified Amazonka.Prelude as Prelude

-- | Settings related to audio encoding. The settings in this group vary
-- depending on the value that you choose for your audio codec.
--
-- /See:/ 'newAudioCodecSettings' smart constructor.
data AudioCodecSettings = AudioCodecSettings'
  { -- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
    -- to the value AIFF.
    AudioCodecSettings -> Maybe AiffSettings
aiffSettings :: Prelude.Maybe AiffSettings,
    -- | Choose the audio codec for this output. Note that the option Dolby
    -- Digital passthrough (PASSTHROUGH) applies only to Dolby Digital and
    -- Dolby Digital Plus audio inputs. Make sure that you choose a codec
    -- that\'s supported with your output container:
    -- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/reference-codecs-containers.html#reference-codecs-containers-output-audio
    -- For audio-only outputs, make sure that both your input audio codec and
    -- your output audio codec are supported for audio-only workflows. For more
    -- information, see:
    -- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/reference-codecs-containers-input.html#reference-codecs-containers-input-audio-only
    -- and
    -- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/reference-codecs-containers.html#audio-only-output
    AudioCodecSettings -> Maybe AudioCodec
codec :: Prelude.Maybe AudioCodec,
    -- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
    -- to the value AC3.
    AudioCodecSettings -> Maybe Ac3Settings
ac3Settings :: Prelude.Maybe Ac3Settings,
    -- | Required when you set Codec, under AudioDescriptions>CodecSettings, to
    -- the value OPUS.
    AudioCodecSettings -> Maybe OpusSettings
opusSettings :: Prelude.Maybe OpusSettings,
    -- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
    -- to the value MP2.
    AudioCodecSettings -> Maybe Mp2Settings
mp2Settings :: Prelude.Maybe Mp2Settings,
    -- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
    -- to the value WAV.
    AudioCodecSettings -> Maybe WavSettings
wavSettings :: Prelude.Maybe WavSettings,
    -- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
    -- to the value EAC3_ATMOS.
    AudioCodecSettings -> Maybe Eac3AtmosSettings
eac3AtmosSettings :: Prelude.Maybe Eac3AtmosSettings,
    -- | Required when you set Codec, under AudioDescriptions>CodecSettings, to
    -- the value MP3.
    AudioCodecSettings -> Maybe Mp3Settings
mp3Settings :: Prelude.Maybe Mp3Settings,
    -- | Required when you set Codec, under AudioDescriptions>CodecSettings, to
    -- the value Vorbis.
    AudioCodecSettings -> Maybe VorbisSettings
vorbisSettings :: Prelude.Maybe VorbisSettings,
    -- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
    -- to the value AAC. The service accepts one of two mutually exclusive
    -- groups of AAC settings--VBR and CBR. To select one of these modes, set
    -- the value of Bitrate control mode (rateControlMode) to \"VBR\" or
    -- \"CBR\". In VBR mode, you control the audio quality with the setting VBR
    -- quality (vbrQuality). In CBR mode, you use the setting Bitrate
    -- (bitrate). Defaults and valid values depend on the rate control mode.
    AudioCodecSettings -> Maybe AacSettings
aacSettings :: Prelude.Maybe AacSettings,
    -- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
    -- to the value EAC3.
    AudioCodecSettings -> Maybe Eac3Settings
eac3Settings :: Prelude.Maybe Eac3Settings
  }
  deriving (AudioCodecSettings -> AudioCodecSettings -> Bool
(AudioCodecSettings -> AudioCodecSettings -> Bool)
-> (AudioCodecSettings -> AudioCodecSettings -> Bool)
-> Eq AudioCodecSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioCodecSettings -> AudioCodecSettings -> Bool
$c/= :: AudioCodecSettings -> AudioCodecSettings -> Bool
== :: AudioCodecSettings -> AudioCodecSettings -> Bool
$c== :: AudioCodecSettings -> AudioCodecSettings -> Bool
Prelude.Eq, ReadPrec [AudioCodecSettings]
ReadPrec AudioCodecSettings
Int -> ReadS AudioCodecSettings
ReadS [AudioCodecSettings]
(Int -> ReadS AudioCodecSettings)
-> ReadS [AudioCodecSettings]
-> ReadPrec AudioCodecSettings
-> ReadPrec [AudioCodecSettings]
-> Read AudioCodecSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioCodecSettings]
$creadListPrec :: ReadPrec [AudioCodecSettings]
readPrec :: ReadPrec AudioCodecSettings
$creadPrec :: ReadPrec AudioCodecSettings
readList :: ReadS [AudioCodecSettings]
$creadList :: ReadS [AudioCodecSettings]
readsPrec :: Int -> ReadS AudioCodecSettings
$creadsPrec :: Int -> ReadS AudioCodecSettings
Prelude.Read, Int -> AudioCodecSettings -> ShowS
[AudioCodecSettings] -> ShowS
AudioCodecSettings -> String
(Int -> AudioCodecSettings -> ShowS)
-> (AudioCodecSettings -> String)
-> ([AudioCodecSettings] -> ShowS)
-> Show AudioCodecSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioCodecSettings] -> ShowS
$cshowList :: [AudioCodecSettings] -> ShowS
show :: AudioCodecSettings -> String
$cshow :: AudioCodecSettings -> String
showsPrec :: Int -> AudioCodecSettings -> ShowS
$cshowsPrec :: Int -> AudioCodecSettings -> ShowS
Prelude.Show, (forall x. AudioCodecSettings -> Rep AudioCodecSettings x)
-> (forall x. Rep AudioCodecSettings x -> AudioCodecSettings)
-> Generic AudioCodecSettings
forall x. Rep AudioCodecSettings x -> AudioCodecSettings
forall x. AudioCodecSettings -> Rep AudioCodecSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AudioCodecSettings x -> AudioCodecSettings
$cfrom :: forall x. AudioCodecSettings -> Rep AudioCodecSettings x
Prelude.Generic)

-- |
-- Create a value of 'AudioCodecSettings' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'aiffSettings', 'audioCodecSettings_aiffSettings' - Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value AIFF.
--
-- 'codec', 'audioCodecSettings_codec' - Choose the audio codec for this output. Note that the option Dolby
-- Digital passthrough (PASSTHROUGH) applies only to Dolby Digital and
-- Dolby Digital Plus audio inputs. Make sure that you choose a codec
-- that\'s supported with your output container:
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/reference-codecs-containers.html#reference-codecs-containers-output-audio
-- For audio-only outputs, make sure that both your input audio codec and
-- your output audio codec are supported for audio-only workflows. For more
-- information, see:
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/reference-codecs-containers-input.html#reference-codecs-containers-input-audio-only
-- and
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/reference-codecs-containers.html#audio-only-output
--
-- 'ac3Settings', 'audioCodecSettings_ac3Settings' - Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value AC3.
--
-- 'opusSettings', 'audioCodecSettings_opusSettings' - Required when you set Codec, under AudioDescriptions>CodecSettings, to
-- the value OPUS.
--
-- 'mp2Settings', 'audioCodecSettings_mp2Settings' - Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value MP2.
--
-- 'wavSettings', 'audioCodecSettings_wavSettings' - Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value WAV.
--
-- 'eac3AtmosSettings', 'audioCodecSettings_eac3AtmosSettings' - Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value EAC3_ATMOS.
--
-- 'mp3Settings', 'audioCodecSettings_mp3Settings' - Required when you set Codec, under AudioDescriptions>CodecSettings, to
-- the value MP3.
--
-- 'vorbisSettings', 'audioCodecSettings_vorbisSettings' - Required when you set Codec, under AudioDescriptions>CodecSettings, to
-- the value Vorbis.
--
-- 'aacSettings', 'audioCodecSettings_aacSettings' - Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value AAC. The service accepts one of two mutually exclusive
-- groups of AAC settings--VBR and CBR. To select one of these modes, set
-- the value of Bitrate control mode (rateControlMode) to \"VBR\" or
-- \"CBR\". In VBR mode, you control the audio quality with the setting VBR
-- quality (vbrQuality). In CBR mode, you use the setting Bitrate
-- (bitrate). Defaults and valid values depend on the rate control mode.
--
-- 'eac3Settings', 'audioCodecSettings_eac3Settings' - Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value EAC3.
newAudioCodecSettings ::
  AudioCodecSettings
newAudioCodecSettings :: AudioCodecSettings
newAudioCodecSettings =
  AudioCodecSettings' :: Maybe AiffSettings
-> Maybe AudioCodec
-> Maybe Ac3Settings
-> Maybe OpusSettings
-> Maybe Mp2Settings
-> Maybe WavSettings
-> Maybe Eac3AtmosSettings
-> Maybe Mp3Settings
-> Maybe VorbisSettings
-> Maybe AacSettings
-> Maybe Eac3Settings
-> AudioCodecSettings
AudioCodecSettings'
    { $sel:aiffSettings:AudioCodecSettings' :: Maybe AiffSettings
aiffSettings = Maybe AiffSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:codec:AudioCodecSettings' :: Maybe AudioCodec
codec = Maybe AudioCodec
forall a. Maybe a
Prelude.Nothing,
      $sel:ac3Settings:AudioCodecSettings' :: Maybe Ac3Settings
ac3Settings = Maybe Ac3Settings
forall a. Maybe a
Prelude.Nothing,
      $sel:opusSettings:AudioCodecSettings' :: Maybe OpusSettings
opusSettings = Maybe OpusSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:mp2Settings:AudioCodecSettings' :: Maybe Mp2Settings
mp2Settings = Maybe Mp2Settings
forall a. Maybe a
Prelude.Nothing,
      $sel:wavSettings:AudioCodecSettings' :: Maybe WavSettings
wavSettings = Maybe WavSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:eac3AtmosSettings:AudioCodecSettings' :: Maybe Eac3AtmosSettings
eac3AtmosSettings = Maybe Eac3AtmosSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:mp3Settings:AudioCodecSettings' :: Maybe Mp3Settings
mp3Settings = Maybe Mp3Settings
forall a. Maybe a
Prelude.Nothing,
      $sel:vorbisSettings:AudioCodecSettings' :: Maybe VorbisSettings
vorbisSettings = Maybe VorbisSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:aacSettings:AudioCodecSettings' :: Maybe AacSettings
aacSettings = Maybe AacSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:eac3Settings:AudioCodecSettings' :: Maybe Eac3Settings
eac3Settings = Maybe Eac3Settings
forall a. Maybe a
Prelude.Nothing
    }

-- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value AIFF.
audioCodecSettings_aiffSettings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe AiffSettings)
audioCodecSettings_aiffSettings :: (Maybe AiffSettings -> f (Maybe AiffSettings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_aiffSettings = (AudioCodecSettings -> Maybe AiffSettings)
-> (AudioCodecSettings -> Maybe AiffSettings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe AiffSettings)
     (Maybe AiffSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe AiffSettings
aiffSettings :: Maybe AiffSettings
$sel:aiffSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe AiffSettings
aiffSettings} -> Maybe AiffSettings
aiffSettings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe AiffSettings
a -> AudioCodecSettings
s {$sel:aiffSettings:AudioCodecSettings' :: Maybe AiffSettings
aiffSettings = Maybe AiffSettings
a} :: AudioCodecSettings)

-- | Choose the audio codec for this output. Note that the option Dolby
-- Digital passthrough (PASSTHROUGH) applies only to Dolby Digital and
-- Dolby Digital Plus audio inputs. Make sure that you choose a codec
-- that\'s supported with your output container:
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/reference-codecs-containers.html#reference-codecs-containers-output-audio
-- For audio-only outputs, make sure that both your input audio codec and
-- your output audio codec are supported for audio-only workflows. For more
-- information, see:
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/reference-codecs-containers-input.html#reference-codecs-containers-input-audio-only
-- and
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/reference-codecs-containers.html#audio-only-output
audioCodecSettings_codec :: Lens.Lens' AudioCodecSettings (Prelude.Maybe AudioCodec)
audioCodecSettings_codec :: (Maybe AudioCodec -> f (Maybe AudioCodec))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_codec = (AudioCodecSettings -> Maybe AudioCodec)
-> (AudioCodecSettings -> Maybe AudioCodec -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe AudioCodec)
     (Maybe AudioCodec)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe AudioCodec
codec :: Maybe AudioCodec
$sel:codec:AudioCodecSettings' :: AudioCodecSettings -> Maybe AudioCodec
codec} -> Maybe AudioCodec
codec) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe AudioCodec
a -> AudioCodecSettings
s {$sel:codec:AudioCodecSettings' :: Maybe AudioCodec
codec = Maybe AudioCodec
a} :: AudioCodecSettings)

-- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value AC3.
audioCodecSettings_ac3Settings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe Ac3Settings)
audioCodecSettings_ac3Settings :: (Maybe Ac3Settings -> f (Maybe Ac3Settings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_ac3Settings = (AudioCodecSettings -> Maybe Ac3Settings)
-> (AudioCodecSettings -> Maybe Ac3Settings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe Ac3Settings)
     (Maybe Ac3Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe Ac3Settings
ac3Settings :: Maybe Ac3Settings
$sel:ac3Settings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Ac3Settings
ac3Settings} -> Maybe Ac3Settings
ac3Settings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe Ac3Settings
a -> AudioCodecSettings
s {$sel:ac3Settings:AudioCodecSettings' :: Maybe Ac3Settings
ac3Settings = Maybe Ac3Settings
a} :: AudioCodecSettings)

-- | Required when you set Codec, under AudioDescriptions>CodecSettings, to
-- the value OPUS.
audioCodecSettings_opusSettings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe OpusSettings)
audioCodecSettings_opusSettings :: (Maybe OpusSettings -> f (Maybe OpusSettings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_opusSettings = (AudioCodecSettings -> Maybe OpusSettings)
-> (AudioCodecSettings -> Maybe OpusSettings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe OpusSettings)
     (Maybe OpusSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe OpusSettings
opusSettings :: Maybe OpusSettings
$sel:opusSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe OpusSettings
opusSettings} -> Maybe OpusSettings
opusSettings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe OpusSettings
a -> AudioCodecSettings
s {$sel:opusSettings:AudioCodecSettings' :: Maybe OpusSettings
opusSettings = Maybe OpusSettings
a} :: AudioCodecSettings)

-- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value MP2.
audioCodecSettings_mp2Settings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe Mp2Settings)
audioCodecSettings_mp2Settings :: (Maybe Mp2Settings -> f (Maybe Mp2Settings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_mp2Settings = (AudioCodecSettings -> Maybe Mp2Settings)
-> (AudioCodecSettings -> Maybe Mp2Settings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe Mp2Settings)
     (Maybe Mp2Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe Mp2Settings
mp2Settings :: Maybe Mp2Settings
$sel:mp2Settings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Mp2Settings
mp2Settings} -> Maybe Mp2Settings
mp2Settings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe Mp2Settings
a -> AudioCodecSettings
s {$sel:mp2Settings:AudioCodecSettings' :: Maybe Mp2Settings
mp2Settings = Maybe Mp2Settings
a} :: AudioCodecSettings)

-- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value WAV.
audioCodecSettings_wavSettings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe WavSettings)
audioCodecSettings_wavSettings :: (Maybe WavSettings -> f (Maybe WavSettings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_wavSettings = (AudioCodecSettings -> Maybe WavSettings)
-> (AudioCodecSettings -> Maybe WavSettings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe WavSettings)
     (Maybe WavSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe WavSettings
wavSettings :: Maybe WavSettings
$sel:wavSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe WavSettings
wavSettings} -> Maybe WavSettings
wavSettings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe WavSettings
a -> AudioCodecSettings
s {$sel:wavSettings:AudioCodecSettings' :: Maybe WavSettings
wavSettings = Maybe WavSettings
a} :: AudioCodecSettings)

-- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value EAC3_ATMOS.
audioCodecSettings_eac3AtmosSettings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe Eac3AtmosSettings)
audioCodecSettings_eac3AtmosSettings :: (Maybe Eac3AtmosSettings -> f (Maybe Eac3AtmosSettings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_eac3AtmosSettings = (AudioCodecSettings -> Maybe Eac3AtmosSettings)
-> (AudioCodecSettings
    -> Maybe Eac3AtmosSettings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe Eac3AtmosSettings)
     (Maybe Eac3AtmosSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe Eac3AtmosSettings
eac3AtmosSettings :: Maybe Eac3AtmosSettings
$sel:eac3AtmosSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Eac3AtmosSettings
eac3AtmosSettings} -> Maybe Eac3AtmosSettings
eac3AtmosSettings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe Eac3AtmosSettings
a -> AudioCodecSettings
s {$sel:eac3AtmosSettings:AudioCodecSettings' :: Maybe Eac3AtmosSettings
eac3AtmosSettings = Maybe Eac3AtmosSettings
a} :: AudioCodecSettings)

-- | Required when you set Codec, under AudioDescriptions>CodecSettings, to
-- the value MP3.
audioCodecSettings_mp3Settings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe Mp3Settings)
audioCodecSettings_mp3Settings :: (Maybe Mp3Settings -> f (Maybe Mp3Settings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_mp3Settings = (AudioCodecSettings -> Maybe Mp3Settings)
-> (AudioCodecSettings -> Maybe Mp3Settings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe Mp3Settings)
     (Maybe Mp3Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe Mp3Settings
mp3Settings :: Maybe Mp3Settings
$sel:mp3Settings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Mp3Settings
mp3Settings} -> Maybe Mp3Settings
mp3Settings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe Mp3Settings
a -> AudioCodecSettings
s {$sel:mp3Settings:AudioCodecSettings' :: Maybe Mp3Settings
mp3Settings = Maybe Mp3Settings
a} :: AudioCodecSettings)

-- | Required when you set Codec, under AudioDescriptions>CodecSettings, to
-- the value Vorbis.
audioCodecSettings_vorbisSettings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe VorbisSettings)
audioCodecSettings_vorbisSettings :: (Maybe VorbisSettings -> f (Maybe VorbisSettings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_vorbisSettings = (AudioCodecSettings -> Maybe VorbisSettings)
-> (AudioCodecSettings
    -> Maybe VorbisSettings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe VorbisSettings)
     (Maybe VorbisSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe VorbisSettings
vorbisSettings :: Maybe VorbisSettings
$sel:vorbisSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe VorbisSettings
vorbisSettings} -> Maybe VorbisSettings
vorbisSettings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe VorbisSettings
a -> AudioCodecSettings
s {$sel:vorbisSettings:AudioCodecSettings' :: Maybe VorbisSettings
vorbisSettings = Maybe VorbisSettings
a} :: AudioCodecSettings)

-- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value AAC. The service accepts one of two mutually exclusive
-- groups of AAC settings--VBR and CBR. To select one of these modes, set
-- the value of Bitrate control mode (rateControlMode) to \"VBR\" or
-- \"CBR\". In VBR mode, you control the audio quality with the setting VBR
-- quality (vbrQuality). In CBR mode, you use the setting Bitrate
-- (bitrate). Defaults and valid values depend on the rate control mode.
audioCodecSettings_aacSettings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe AacSettings)
audioCodecSettings_aacSettings :: (Maybe AacSettings -> f (Maybe AacSettings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_aacSettings = (AudioCodecSettings -> Maybe AacSettings)
-> (AudioCodecSettings -> Maybe AacSettings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe AacSettings)
     (Maybe AacSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe AacSettings
aacSettings :: Maybe AacSettings
$sel:aacSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe AacSettings
aacSettings} -> Maybe AacSettings
aacSettings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe AacSettings
a -> AudioCodecSettings
s {$sel:aacSettings:AudioCodecSettings' :: Maybe AacSettings
aacSettings = Maybe AacSettings
a} :: AudioCodecSettings)

-- | Required when you set (Codec) under (AudioDescriptions)>(CodecSettings)
-- to the value EAC3.
audioCodecSettings_eac3Settings :: Lens.Lens' AudioCodecSettings (Prelude.Maybe Eac3Settings)
audioCodecSettings_eac3Settings :: (Maybe Eac3Settings -> f (Maybe Eac3Settings))
-> AudioCodecSettings -> f AudioCodecSettings
audioCodecSettings_eac3Settings = (AudioCodecSettings -> Maybe Eac3Settings)
-> (AudioCodecSettings -> Maybe Eac3Settings -> AudioCodecSettings)
-> Lens
     AudioCodecSettings
     AudioCodecSettings
     (Maybe Eac3Settings)
     (Maybe Eac3Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioCodecSettings' {Maybe Eac3Settings
eac3Settings :: Maybe Eac3Settings
$sel:eac3Settings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Eac3Settings
eac3Settings} -> Maybe Eac3Settings
eac3Settings) (\s :: AudioCodecSettings
s@AudioCodecSettings' {} Maybe Eac3Settings
a -> AudioCodecSettings
s {$sel:eac3Settings:AudioCodecSettings' :: Maybe Eac3Settings
eac3Settings = Maybe Eac3Settings
a} :: AudioCodecSettings)

instance Core.FromJSON AudioCodecSettings where
  parseJSON :: Value -> Parser AudioCodecSettings
parseJSON =
    String
-> (Object -> Parser AudioCodecSettings)
-> Value
-> Parser AudioCodecSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AudioCodecSettings"
      ( \Object
x ->
          Maybe AiffSettings
-> Maybe AudioCodec
-> Maybe Ac3Settings
-> Maybe OpusSettings
-> Maybe Mp2Settings
-> Maybe WavSettings
-> Maybe Eac3AtmosSettings
-> Maybe Mp3Settings
-> Maybe VorbisSettings
-> Maybe AacSettings
-> Maybe Eac3Settings
-> AudioCodecSettings
AudioCodecSettings'
            (Maybe AiffSettings
 -> Maybe AudioCodec
 -> Maybe Ac3Settings
 -> Maybe OpusSettings
 -> Maybe Mp2Settings
 -> Maybe WavSettings
 -> Maybe Eac3AtmosSettings
 -> Maybe Mp3Settings
 -> Maybe VorbisSettings
 -> Maybe AacSettings
 -> Maybe Eac3Settings
 -> AudioCodecSettings)
-> Parser (Maybe AiffSettings)
-> Parser
     (Maybe AudioCodec
      -> Maybe Ac3Settings
      -> Maybe OpusSettings
      -> Maybe Mp2Settings
      -> Maybe WavSettings
      -> Maybe Eac3AtmosSettings
      -> Maybe Mp3Settings
      -> Maybe VorbisSettings
      -> Maybe AacSettings
      -> Maybe Eac3Settings
      -> AudioCodecSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AiffSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"aiffSettings")
            Parser
  (Maybe AudioCodec
   -> Maybe Ac3Settings
   -> Maybe OpusSettings
   -> Maybe Mp2Settings
   -> Maybe WavSettings
   -> Maybe Eac3AtmosSettings
   -> Maybe Mp3Settings
   -> Maybe VorbisSettings
   -> Maybe AacSettings
   -> Maybe Eac3Settings
   -> AudioCodecSettings)
-> Parser (Maybe AudioCodec)
-> Parser
     (Maybe Ac3Settings
      -> Maybe OpusSettings
      -> Maybe Mp2Settings
      -> Maybe WavSettings
      -> Maybe Eac3AtmosSettings
      -> Maybe Mp3Settings
      -> Maybe VorbisSettings
      -> Maybe AacSettings
      -> Maybe Eac3Settings
      -> AudioCodecSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioCodec)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"codec")
            Parser
  (Maybe Ac3Settings
   -> Maybe OpusSettings
   -> Maybe Mp2Settings
   -> Maybe WavSettings
   -> Maybe Eac3AtmosSettings
   -> Maybe Mp3Settings
   -> Maybe VorbisSettings
   -> Maybe AacSettings
   -> Maybe Eac3Settings
   -> AudioCodecSettings)
-> Parser (Maybe Ac3Settings)
-> Parser
     (Maybe OpusSettings
      -> Maybe Mp2Settings
      -> Maybe WavSettings
      -> Maybe Eac3AtmosSettings
      -> Maybe Mp3Settings
      -> Maybe VorbisSettings
      -> Maybe AacSettings
      -> Maybe Eac3Settings
      -> AudioCodecSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Ac3Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ac3Settings")
            Parser
  (Maybe OpusSettings
   -> Maybe Mp2Settings
   -> Maybe WavSettings
   -> Maybe Eac3AtmosSettings
   -> Maybe Mp3Settings
   -> Maybe VorbisSettings
   -> Maybe AacSettings
   -> Maybe Eac3Settings
   -> AudioCodecSettings)
-> Parser (Maybe OpusSettings)
-> Parser
     (Maybe Mp2Settings
      -> Maybe WavSettings
      -> Maybe Eac3AtmosSettings
      -> Maybe Mp3Settings
      -> Maybe VorbisSettings
      -> Maybe AacSettings
      -> Maybe Eac3Settings
      -> AudioCodecSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OpusSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"opusSettings")
            Parser
  (Maybe Mp2Settings
   -> Maybe WavSettings
   -> Maybe Eac3AtmosSettings
   -> Maybe Mp3Settings
   -> Maybe VorbisSettings
   -> Maybe AacSettings
   -> Maybe Eac3Settings
   -> AudioCodecSettings)
-> Parser (Maybe Mp2Settings)
-> Parser
     (Maybe WavSettings
      -> Maybe Eac3AtmosSettings
      -> Maybe Mp3Settings
      -> Maybe VorbisSettings
      -> Maybe AacSettings
      -> Maybe Eac3Settings
      -> AudioCodecSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mp2Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mp2Settings")
            Parser
  (Maybe WavSettings
   -> Maybe Eac3AtmosSettings
   -> Maybe Mp3Settings
   -> Maybe VorbisSettings
   -> Maybe AacSettings
   -> Maybe Eac3Settings
   -> AudioCodecSettings)
-> Parser (Maybe WavSettings)
-> Parser
     (Maybe Eac3AtmosSettings
      -> Maybe Mp3Settings
      -> Maybe VorbisSettings
      -> Maybe AacSettings
      -> Maybe Eac3Settings
      -> AudioCodecSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WavSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"wavSettings")
            Parser
  (Maybe Eac3AtmosSettings
   -> Maybe Mp3Settings
   -> Maybe VorbisSettings
   -> Maybe AacSettings
   -> Maybe Eac3Settings
   -> AudioCodecSettings)
-> Parser (Maybe Eac3AtmosSettings)
-> Parser
     (Maybe Mp3Settings
      -> Maybe VorbisSettings
      -> Maybe AacSettings
      -> Maybe Eac3Settings
      -> AudioCodecSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Eac3AtmosSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eac3AtmosSettings")
            Parser
  (Maybe Mp3Settings
   -> Maybe VorbisSettings
   -> Maybe AacSettings
   -> Maybe Eac3Settings
   -> AudioCodecSettings)
-> Parser (Maybe Mp3Settings)
-> Parser
     (Maybe VorbisSettings
      -> Maybe AacSettings -> Maybe Eac3Settings -> AudioCodecSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mp3Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mp3Settings")
            Parser
  (Maybe VorbisSettings
   -> Maybe AacSettings -> Maybe Eac3Settings -> AudioCodecSettings)
-> Parser (Maybe VorbisSettings)
-> Parser
     (Maybe AacSettings -> Maybe Eac3Settings -> AudioCodecSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VorbisSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vorbisSettings")
            Parser
  (Maybe AacSettings -> Maybe Eac3Settings -> AudioCodecSettings)
-> Parser (Maybe AacSettings)
-> Parser (Maybe Eac3Settings -> AudioCodecSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AacSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"aacSettings")
            Parser (Maybe Eac3Settings -> AudioCodecSettings)
-> Parser (Maybe Eac3Settings) -> Parser AudioCodecSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Eac3Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eac3Settings")
      )

instance Prelude.Hashable AudioCodecSettings

instance Prelude.NFData AudioCodecSettings

instance Core.ToJSON AudioCodecSettings where
  toJSON :: AudioCodecSettings -> Value
toJSON AudioCodecSettings' {Maybe AacSettings
Maybe Ac3Settings
Maybe AiffSettings
Maybe AudioCodec
Maybe Eac3AtmosSettings
Maybe Eac3Settings
Maybe Mp2Settings
Maybe Mp3Settings
Maybe OpusSettings
Maybe VorbisSettings
Maybe WavSettings
eac3Settings :: Maybe Eac3Settings
aacSettings :: Maybe AacSettings
vorbisSettings :: Maybe VorbisSettings
mp3Settings :: Maybe Mp3Settings
eac3AtmosSettings :: Maybe Eac3AtmosSettings
wavSettings :: Maybe WavSettings
mp2Settings :: Maybe Mp2Settings
opusSettings :: Maybe OpusSettings
ac3Settings :: Maybe Ac3Settings
codec :: Maybe AudioCodec
aiffSettings :: Maybe AiffSettings
$sel:eac3Settings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Eac3Settings
$sel:aacSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe AacSettings
$sel:vorbisSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe VorbisSettings
$sel:mp3Settings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Mp3Settings
$sel:eac3AtmosSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Eac3AtmosSettings
$sel:wavSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe WavSettings
$sel:mp2Settings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Mp2Settings
$sel:opusSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe OpusSettings
$sel:ac3Settings:AudioCodecSettings' :: AudioCodecSettings -> Maybe Ac3Settings
$sel:codec:AudioCodecSettings' :: AudioCodecSettings -> Maybe AudioCodec
$sel:aiffSettings:AudioCodecSettings' :: AudioCodecSettings -> Maybe AiffSettings
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"aiffSettings" Text -> AiffSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AiffSettings -> Pair) -> Maybe AiffSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AiffSettings
aiffSettings,
            (Text
"codec" Text -> AudioCodec -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AudioCodec -> Pair) -> Maybe AudioCodec -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioCodec
codec,
            (Text
"ac3Settings" Text -> Ac3Settings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Ac3Settings -> Pair) -> Maybe Ac3Settings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Ac3Settings
ac3Settings,
            (Text
"opusSettings" Text -> OpusSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OpusSettings -> Pair) -> Maybe OpusSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OpusSettings
opusSettings,
            (Text
"mp2Settings" Text -> Mp2Settings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mp2Settings -> Pair) -> Maybe Mp2Settings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mp2Settings
mp2Settings,
            (Text
"wavSettings" Text -> WavSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (WavSettings -> Pair) -> Maybe WavSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WavSettings
wavSettings,
            (Text
"eac3AtmosSettings" Text -> Eac3AtmosSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Eac3AtmosSettings -> Pair)
-> Maybe Eac3AtmosSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Eac3AtmosSettings
eac3AtmosSettings,
            (Text
"mp3Settings" Text -> Mp3Settings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mp3Settings -> Pair) -> Maybe Mp3Settings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mp3Settings
mp3Settings,
            (Text
"vorbisSettings" Text -> VorbisSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (VorbisSettings -> Pair) -> Maybe VorbisSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VorbisSettings
vorbisSettings,
            (Text
"aacSettings" Text -> AacSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AacSettings -> Pair) -> Maybe AacSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AacSettings
aacSettings,
            (Text
"eac3Settings" Text -> Eac3Settings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Eac3Settings -> Pair) -> Maybe Eac3Settings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Eac3Settings
eac3Settings
          ]
      )