{-# 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.ElasticTranscoder.Types.AudioParameters
-- 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.ElasticTranscoder.Types.AudioParameters where

import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.Types.AudioCodecOptions
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Parameters required for transcoding audio.
--
-- /See:/ 'newAudioParameters' smart constructor.
data AudioParameters = AudioParameters'
  { -- | The number of audio channels in the output file. The following values
    -- are valid:
    --
    -- @auto@, @0@, @1@, @2@
    --
    -- One channel carries the information played by a single speaker. For
    -- example, a stereo track with two channels sends one channel to the left
    -- speaker, and the other channel to the right speaker. The output channels
    -- are organized into tracks. If you want Elastic Transcoder to
    -- automatically detect the number of audio channels in the input file and
    -- use that value for the output file, select @auto@.
    --
    -- The output of a specific channel value and inputs are as follows:
    --
    -- -   @auto@ __channel specified, with any input:__ Pass through up to
    --     eight input channels.
    --
    -- -   @0@ __channels specified, with any input:__ Audio omitted from the
    --     output.
    --
    -- -   @1@ __channel specified, with at least one input channel:__ Mono
    --     sound.
    --
    -- -   @2@ __channels specified, with any input:__ Two identical mono
    --     channels or stereo. For more information about tracks, see
    --     @Audio:AudioPackingMode.@
    --
    -- For more information about how Elastic Transcoder organizes channels and
    -- tracks, see @Audio:AudioPackingMode@.
    AudioParameters -> Maybe Text
channels :: Prelude.Maybe Prelude.Text,
    -- | The audio codec for the output file. Valid values include @aac@, @flac@,
    -- @mp2@, @mp3@, @pcm@, and @vorbis@.
    AudioParameters -> Maybe Text
codec :: Prelude.Maybe Prelude.Text,
    -- | The method of organizing audio channels and tracks. Use @Audio:Channels@
    -- to specify the number of channels in your output, and
    -- @Audio:AudioPackingMode@ to specify the number of tracks and their
    -- relation to the channels. If you do not specify an
    -- @Audio:AudioPackingMode@, Elastic Transcoder uses @SingleTrack@.
    --
    -- The following values are valid:
    --
    -- @SingleTrack@, @OneChannelPerTrack@, and
    -- @OneChannelPerTrackWithMosTo8Tracks@
    --
    -- When you specify @SingleTrack@, Elastic Transcoder creates a single
    -- track for your output. The track can have up to eight channels. Use
    -- @SingleTrack@ for all non-@mxf@ containers.
    --
    -- The outputs of @SingleTrack@ for a specific channel value and inputs are
    -- as follows:
    --
    -- -   @0@ __channels with any input:__ Audio omitted from the output
    --
    -- -   @1, 2, or auto @ __channels with no audio input:__ Audio omitted
    --     from the output
    --
    -- -   @1 @ __channel with any input with audio:__ One track with one
    --     channel, downmixed if necessary
    --
    -- -   @2 @ __channels with one track with one channel:__ One track with
    --     two identical channels
    --
    -- -   @2 or auto @ __channels with two tracks with one channel each:__ One
    --     track with two channels
    --
    -- -   @2 or auto @ __channels with one track with two channels:__ One
    --     track with two channels
    --
    -- -   @2 @ __channels with one track with multiple channels:__ One track
    --     with two channels
    --
    -- -   @auto @ __channels with one track with one channel:__ One track with
    --     one channel
    --
    -- -   @auto @ __channels with one track with multiple channels:__ One
    --     track with multiple channels
    --
    -- When you specify @OneChannelPerTrack@, Elastic Transcoder creates a new
    -- track for every channel in your output. Your output can have up to eight
    -- single-channel tracks.
    --
    -- The outputs of @OneChannelPerTrack@ for a specific channel value and
    -- inputs are as follows:
    --
    -- -   @0 @ __channels with any input:__ Audio omitted from the output
    --
    -- -   @1, 2, or auto @ __channels with no audio input:__ Audio omitted
    --     from the output
    --
    -- -   @1 @ __channel with any input with audio:__ One track with one
    --     channel, downmixed if necessary
    --
    -- -   @2 @ __channels with one track with one channel:__ Two tracks with
    --     one identical channel each
    --
    -- -   @2 or auto @ __channels with two tracks with one channel each:__ Two
    --     tracks with one channel each
    --
    -- -   @2 or auto @ __channels with one track with two channels:__ Two
    --     tracks with one channel each
    --
    -- -   @2 @ __channels with one track with multiple channels:__ Two tracks
    --     with one channel each
    --
    -- -   @auto @ __channels with one track with one channel:__ One track with
    --     one channel
    --
    -- -   @auto @ __channels with one track with multiple channels:__ Up to
    --     eight tracks with one channel each
    --
    -- When you specify @OneChannelPerTrackWithMosTo8Tracks@, Elastic
    -- Transcoder creates eight single-channel tracks for your output. All
    -- tracks that do not contain audio data from an input channel are MOS, or
    -- Mit Out Sound, tracks.
    --
    -- The outputs of @OneChannelPerTrackWithMosTo8Tracks@ for a specific
    -- channel value and inputs are as follows:
    --
    -- -   @0 @ __channels with any input:__ Audio omitted from the output
    --
    -- -   @1, 2, or auto @ __channels with no audio input:__ Audio omitted
    --     from the output
    --
    -- -   @1 @ __channel with any input with audio:__ One track with one
    --     channel, downmixed if necessary, plus six MOS tracks
    --
    -- -   @2 @ __channels with one track with one channel:__ Two tracks with
    --     one identical channel each, plus six MOS tracks
    --
    -- -   @2 or auto @ __channels with two tracks with one channel each:__ Two
    --     tracks with one channel each, plus six MOS tracks
    --
    -- -   @2 or auto @ __channels with one track with two channels:__ Two
    --     tracks with one channel each, plus six MOS tracks
    --
    -- -   @2 @ __channels with one track with multiple channels:__ Two tracks
    --     with one channel each, plus six MOS tracks
    --
    -- -   @auto @ __channels with one track with one channel:__ One track with
    --     one channel, plus seven MOS tracks
    --
    -- -   @auto @ __channels with one track with multiple channels:__ Up to
    --     eight tracks with one channel each, plus MOS tracks until there are
    --     eight tracks in all
    AudioParameters -> Maybe Text
audioPackingMode :: Prelude.Maybe Prelude.Text,
    -- | The sample rate of the audio stream in the output file, in Hertz. Valid
    -- values include:
    --
    -- @auto@, @22050@, @32000@, @44100@, @48000@, @96000@
    --
    -- If you specify @auto@, Elastic Transcoder automatically detects the
    -- sample rate.
    AudioParameters -> Maybe Text
sampleRate :: Prelude.Maybe Prelude.Text,
    -- | The bit rate of the audio stream in the output file, in
    -- kilobits\/second. Enter an integer between 64 and 320, inclusive.
    AudioParameters -> Maybe Text
bitRate :: Prelude.Maybe Prelude.Text,
    -- | If you specified @AAC@ for @Audio:Codec@, this is the @AAC@ compression
    -- profile to use. Valid values include:
    --
    -- @auto@, @AAC-LC@, @HE-AAC@, @HE-AACv2@
    --
    -- If you specify @auto@, Elastic Transcoder chooses a profile based on the
    -- bit rate of the output file.
    AudioParameters -> Maybe AudioCodecOptions
codecOptions :: Prelude.Maybe AudioCodecOptions
  }
  deriving (AudioParameters -> AudioParameters -> Bool
(AudioParameters -> AudioParameters -> Bool)
-> (AudioParameters -> AudioParameters -> Bool)
-> Eq AudioParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioParameters -> AudioParameters -> Bool
$c/= :: AudioParameters -> AudioParameters -> Bool
== :: AudioParameters -> AudioParameters -> Bool
$c== :: AudioParameters -> AudioParameters -> Bool
Prelude.Eq, ReadPrec [AudioParameters]
ReadPrec AudioParameters
Int -> ReadS AudioParameters
ReadS [AudioParameters]
(Int -> ReadS AudioParameters)
-> ReadS [AudioParameters]
-> ReadPrec AudioParameters
-> ReadPrec [AudioParameters]
-> Read AudioParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioParameters]
$creadListPrec :: ReadPrec [AudioParameters]
readPrec :: ReadPrec AudioParameters
$creadPrec :: ReadPrec AudioParameters
readList :: ReadS [AudioParameters]
$creadList :: ReadS [AudioParameters]
readsPrec :: Int -> ReadS AudioParameters
$creadsPrec :: Int -> ReadS AudioParameters
Prelude.Read, Int -> AudioParameters -> ShowS
[AudioParameters] -> ShowS
AudioParameters -> String
(Int -> AudioParameters -> ShowS)
-> (AudioParameters -> String)
-> ([AudioParameters] -> ShowS)
-> Show AudioParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioParameters] -> ShowS
$cshowList :: [AudioParameters] -> ShowS
show :: AudioParameters -> String
$cshow :: AudioParameters -> String
showsPrec :: Int -> AudioParameters -> ShowS
$cshowsPrec :: Int -> AudioParameters -> ShowS
Prelude.Show, (forall x. AudioParameters -> Rep AudioParameters x)
-> (forall x. Rep AudioParameters x -> AudioParameters)
-> Generic AudioParameters
forall x. Rep AudioParameters x -> AudioParameters
forall x. AudioParameters -> Rep AudioParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AudioParameters x -> AudioParameters
$cfrom :: forall x. AudioParameters -> Rep AudioParameters x
Prelude.Generic)

-- |
-- Create a value of 'AudioParameters' 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:
--
-- 'channels', 'audioParameters_channels' - The number of audio channels in the output file. The following values
-- are valid:
--
-- @auto@, @0@, @1@, @2@
--
-- One channel carries the information played by a single speaker. For
-- example, a stereo track with two channels sends one channel to the left
-- speaker, and the other channel to the right speaker. The output channels
-- are organized into tracks. If you want Elastic Transcoder to
-- automatically detect the number of audio channels in the input file and
-- use that value for the output file, select @auto@.
--
-- The output of a specific channel value and inputs are as follows:
--
-- -   @auto@ __channel specified, with any input:__ Pass through up to
--     eight input channels.
--
-- -   @0@ __channels specified, with any input:__ Audio omitted from the
--     output.
--
-- -   @1@ __channel specified, with at least one input channel:__ Mono
--     sound.
--
-- -   @2@ __channels specified, with any input:__ Two identical mono
--     channels or stereo. For more information about tracks, see
--     @Audio:AudioPackingMode.@
--
-- For more information about how Elastic Transcoder organizes channels and
-- tracks, see @Audio:AudioPackingMode@.
--
-- 'codec', 'audioParameters_codec' - The audio codec for the output file. Valid values include @aac@, @flac@,
-- @mp2@, @mp3@, @pcm@, and @vorbis@.
--
-- 'audioPackingMode', 'audioParameters_audioPackingMode' - The method of organizing audio channels and tracks. Use @Audio:Channels@
-- to specify the number of channels in your output, and
-- @Audio:AudioPackingMode@ to specify the number of tracks and their
-- relation to the channels. If you do not specify an
-- @Audio:AudioPackingMode@, Elastic Transcoder uses @SingleTrack@.
--
-- The following values are valid:
--
-- @SingleTrack@, @OneChannelPerTrack@, and
-- @OneChannelPerTrackWithMosTo8Tracks@
--
-- When you specify @SingleTrack@, Elastic Transcoder creates a single
-- track for your output. The track can have up to eight channels. Use
-- @SingleTrack@ for all non-@mxf@ containers.
--
-- The outputs of @SingleTrack@ for a specific channel value and inputs are
-- as follows:
--
-- -   @0@ __channels with any input:__ Audio omitted from the output
--
-- -   @1, 2, or auto @ __channels with no audio input:__ Audio omitted
--     from the output
--
-- -   @1 @ __channel with any input with audio:__ One track with one
--     channel, downmixed if necessary
--
-- -   @2 @ __channels with one track with one channel:__ One track with
--     two identical channels
--
-- -   @2 or auto @ __channels with two tracks with one channel each:__ One
--     track with two channels
--
-- -   @2 or auto @ __channels with one track with two channels:__ One
--     track with two channels
--
-- -   @2 @ __channels with one track with multiple channels:__ One track
--     with two channels
--
-- -   @auto @ __channels with one track with one channel:__ One track with
--     one channel
--
-- -   @auto @ __channels with one track with multiple channels:__ One
--     track with multiple channels
--
-- When you specify @OneChannelPerTrack@, Elastic Transcoder creates a new
-- track for every channel in your output. Your output can have up to eight
-- single-channel tracks.
--
-- The outputs of @OneChannelPerTrack@ for a specific channel value and
-- inputs are as follows:
--
-- -   @0 @ __channels with any input:__ Audio omitted from the output
--
-- -   @1, 2, or auto @ __channels with no audio input:__ Audio omitted
--     from the output
--
-- -   @1 @ __channel with any input with audio:__ One track with one
--     channel, downmixed if necessary
--
-- -   @2 @ __channels with one track with one channel:__ Two tracks with
--     one identical channel each
--
-- -   @2 or auto @ __channels with two tracks with one channel each:__ Two
--     tracks with one channel each
--
-- -   @2 or auto @ __channels with one track with two channels:__ Two
--     tracks with one channel each
--
-- -   @2 @ __channels with one track with multiple channels:__ Two tracks
--     with one channel each
--
-- -   @auto @ __channels with one track with one channel:__ One track with
--     one channel
--
-- -   @auto @ __channels with one track with multiple channels:__ Up to
--     eight tracks with one channel each
--
-- When you specify @OneChannelPerTrackWithMosTo8Tracks@, Elastic
-- Transcoder creates eight single-channel tracks for your output. All
-- tracks that do not contain audio data from an input channel are MOS, or
-- Mit Out Sound, tracks.
--
-- The outputs of @OneChannelPerTrackWithMosTo8Tracks@ for a specific
-- channel value and inputs are as follows:
--
-- -   @0 @ __channels with any input:__ Audio omitted from the output
--
-- -   @1, 2, or auto @ __channels with no audio input:__ Audio omitted
--     from the output
--
-- -   @1 @ __channel with any input with audio:__ One track with one
--     channel, downmixed if necessary, plus six MOS tracks
--
-- -   @2 @ __channels with one track with one channel:__ Two tracks with
--     one identical channel each, plus six MOS tracks
--
-- -   @2 or auto @ __channels with two tracks with one channel each:__ Two
--     tracks with one channel each, plus six MOS tracks
--
-- -   @2 or auto @ __channels with one track with two channels:__ Two
--     tracks with one channel each, plus six MOS tracks
--
-- -   @2 @ __channels with one track with multiple channels:__ Two tracks
--     with one channel each, plus six MOS tracks
--
-- -   @auto @ __channels with one track with one channel:__ One track with
--     one channel, plus seven MOS tracks
--
-- -   @auto @ __channels with one track with multiple channels:__ Up to
--     eight tracks with one channel each, plus MOS tracks until there are
--     eight tracks in all
--
-- 'sampleRate', 'audioParameters_sampleRate' - The sample rate of the audio stream in the output file, in Hertz. Valid
-- values include:
--
-- @auto@, @22050@, @32000@, @44100@, @48000@, @96000@
--
-- If you specify @auto@, Elastic Transcoder automatically detects the
-- sample rate.
--
-- 'bitRate', 'audioParameters_bitRate' - The bit rate of the audio stream in the output file, in
-- kilobits\/second. Enter an integer between 64 and 320, inclusive.
--
-- 'codecOptions', 'audioParameters_codecOptions' - If you specified @AAC@ for @Audio:Codec@, this is the @AAC@ compression
-- profile to use. Valid values include:
--
-- @auto@, @AAC-LC@, @HE-AAC@, @HE-AACv2@
--
-- If you specify @auto@, Elastic Transcoder chooses a profile based on the
-- bit rate of the output file.
newAudioParameters ::
  AudioParameters
newAudioParameters :: AudioParameters
newAudioParameters =
  AudioParameters' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AudioCodecOptions
-> AudioParameters
AudioParameters'
    { $sel:channels:AudioParameters' :: Maybe Text
channels = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:codec:AudioParameters' :: Maybe Text
codec = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:audioPackingMode:AudioParameters' :: Maybe Text
audioPackingMode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sampleRate:AudioParameters' :: Maybe Text
sampleRate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bitRate:AudioParameters' :: Maybe Text
bitRate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:codecOptions:AudioParameters' :: Maybe AudioCodecOptions
codecOptions = Maybe AudioCodecOptions
forall a. Maybe a
Prelude.Nothing
    }

-- | The number of audio channels in the output file. The following values
-- are valid:
--
-- @auto@, @0@, @1@, @2@
--
-- One channel carries the information played by a single speaker. For
-- example, a stereo track with two channels sends one channel to the left
-- speaker, and the other channel to the right speaker. The output channels
-- are organized into tracks. If you want Elastic Transcoder to
-- automatically detect the number of audio channels in the input file and
-- use that value for the output file, select @auto@.
--
-- The output of a specific channel value and inputs are as follows:
--
-- -   @auto@ __channel specified, with any input:__ Pass through up to
--     eight input channels.
--
-- -   @0@ __channels specified, with any input:__ Audio omitted from the
--     output.
--
-- -   @1@ __channel specified, with at least one input channel:__ Mono
--     sound.
--
-- -   @2@ __channels specified, with any input:__ Two identical mono
--     channels or stereo. For more information about tracks, see
--     @Audio:AudioPackingMode.@
--
-- For more information about how Elastic Transcoder organizes channels and
-- tracks, see @Audio:AudioPackingMode@.
audioParameters_channels :: Lens.Lens' AudioParameters (Prelude.Maybe Prelude.Text)
audioParameters_channels :: (Maybe Text -> f (Maybe Text))
-> AudioParameters -> f AudioParameters
audioParameters_channels = (AudioParameters -> Maybe Text)
-> (AudioParameters -> Maybe Text -> AudioParameters)
-> Lens AudioParameters AudioParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioParameters' {Maybe Text
channels :: Maybe Text
$sel:channels:AudioParameters' :: AudioParameters -> Maybe Text
channels} -> Maybe Text
channels) (\s :: AudioParameters
s@AudioParameters' {} Maybe Text
a -> AudioParameters
s {$sel:channels:AudioParameters' :: Maybe Text
channels = Maybe Text
a} :: AudioParameters)

-- | The audio codec for the output file. Valid values include @aac@, @flac@,
-- @mp2@, @mp3@, @pcm@, and @vorbis@.
audioParameters_codec :: Lens.Lens' AudioParameters (Prelude.Maybe Prelude.Text)
audioParameters_codec :: (Maybe Text -> f (Maybe Text))
-> AudioParameters -> f AudioParameters
audioParameters_codec = (AudioParameters -> Maybe Text)
-> (AudioParameters -> Maybe Text -> AudioParameters)
-> Lens AudioParameters AudioParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioParameters' {Maybe Text
codec :: Maybe Text
$sel:codec:AudioParameters' :: AudioParameters -> Maybe Text
codec} -> Maybe Text
codec) (\s :: AudioParameters
s@AudioParameters' {} Maybe Text
a -> AudioParameters
s {$sel:codec:AudioParameters' :: Maybe Text
codec = Maybe Text
a} :: AudioParameters)

-- | The method of organizing audio channels and tracks. Use @Audio:Channels@
-- to specify the number of channels in your output, and
-- @Audio:AudioPackingMode@ to specify the number of tracks and their
-- relation to the channels. If you do not specify an
-- @Audio:AudioPackingMode@, Elastic Transcoder uses @SingleTrack@.
--
-- The following values are valid:
--
-- @SingleTrack@, @OneChannelPerTrack@, and
-- @OneChannelPerTrackWithMosTo8Tracks@
--
-- When you specify @SingleTrack@, Elastic Transcoder creates a single
-- track for your output. The track can have up to eight channels. Use
-- @SingleTrack@ for all non-@mxf@ containers.
--
-- The outputs of @SingleTrack@ for a specific channel value and inputs are
-- as follows:
--
-- -   @0@ __channels with any input:__ Audio omitted from the output
--
-- -   @1, 2, or auto @ __channels with no audio input:__ Audio omitted
--     from the output
--
-- -   @1 @ __channel with any input with audio:__ One track with one
--     channel, downmixed if necessary
--
-- -   @2 @ __channels with one track with one channel:__ One track with
--     two identical channels
--
-- -   @2 or auto @ __channels with two tracks with one channel each:__ One
--     track with two channels
--
-- -   @2 or auto @ __channels with one track with two channels:__ One
--     track with two channels
--
-- -   @2 @ __channels with one track with multiple channels:__ One track
--     with two channels
--
-- -   @auto @ __channels with one track with one channel:__ One track with
--     one channel
--
-- -   @auto @ __channels with one track with multiple channels:__ One
--     track with multiple channels
--
-- When you specify @OneChannelPerTrack@, Elastic Transcoder creates a new
-- track for every channel in your output. Your output can have up to eight
-- single-channel tracks.
--
-- The outputs of @OneChannelPerTrack@ for a specific channel value and
-- inputs are as follows:
--
-- -   @0 @ __channels with any input:__ Audio omitted from the output
--
-- -   @1, 2, or auto @ __channels with no audio input:__ Audio omitted
--     from the output
--
-- -   @1 @ __channel with any input with audio:__ One track with one
--     channel, downmixed if necessary
--
-- -   @2 @ __channels with one track with one channel:__ Two tracks with
--     one identical channel each
--
-- -   @2 or auto @ __channels with two tracks with one channel each:__ Two
--     tracks with one channel each
--
-- -   @2 or auto @ __channels with one track with two channels:__ Two
--     tracks with one channel each
--
-- -   @2 @ __channels with one track with multiple channels:__ Two tracks
--     with one channel each
--
-- -   @auto @ __channels with one track with one channel:__ One track with
--     one channel
--
-- -   @auto @ __channels with one track with multiple channels:__ Up to
--     eight tracks with one channel each
--
-- When you specify @OneChannelPerTrackWithMosTo8Tracks@, Elastic
-- Transcoder creates eight single-channel tracks for your output. All
-- tracks that do not contain audio data from an input channel are MOS, or
-- Mit Out Sound, tracks.
--
-- The outputs of @OneChannelPerTrackWithMosTo8Tracks@ for a specific
-- channel value and inputs are as follows:
--
-- -   @0 @ __channels with any input:__ Audio omitted from the output
--
-- -   @1, 2, or auto @ __channels with no audio input:__ Audio omitted
--     from the output
--
-- -   @1 @ __channel with any input with audio:__ One track with one
--     channel, downmixed if necessary, plus six MOS tracks
--
-- -   @2 @ __channels with one track with one channel:__ Two tracks with
--     one identical channel each, plus six MOS tracks
--
-- -   @2 or auto @ __channels with two tracks with one channel each:__ Two
--     tracks with one channel each, plus six MOS tracks
--
-- -   @2 or auto @ __channels with one track with two channels:__ Two
--     tracks with one channel each, plus six MOS tracks
--
-- -   @2 @ __channels with one track with multiple channels:__ Two tracks
--     with one channel each, plus six MOS tracks
--
-- -   @auto @ __channels with one track with one channel:__ One track with
--     one channel, plus seven MOS tracks
--
-- -   @auto @ __channels with one track with multiple channels:__ Up to
--     eight tracks with one channel each, plus MOS tracks until there are
--     eight tracks in all
audioParameters_audioPackingMode :: Lens.Lens' AudioParameters (Prelude.Maybe Prelude.Text)
audioParameters_audioPackingMode :: (Maybe Text -> f (Maybe Text))
-> AudioParameters -> f AudioParameters
audioParameters_audioPackingMode = (AudioParameters -> Maybe Text)
-> (AudioParameters -> Maybe Text -> AudioParameters)
-> Lens AudioParameters AudioParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioParameters' {Maybe Text
audioPackingMode :: Maybe Text
$sel:audioPackingMode:AudioParameters' :: AudioParameters -> Maybe Text
audioPackingMode} -> Maybe Text
audioPackingMode) (\s :: AudioParameters
s@AudioParameters' {} Maybe Text
a -> AudioParameters
s {$sel:audioPackingMode:AudioParameters' :: Maybe Text
audioPackingMode = Maybe Text
a} :: AudioParameters)

-- | The sample rate of the audio stream in the output file, in Hertz. Valid
-- values include:
--
-- @auto@, @22050@, @32000@, @44100@, @48000@, @96000@
--
-- If you specify @auto@, Elastic Transcoder automatically detects the
-- sample rate.
audioParameters_sampleRate :: Lens.Lens' AudioParameters (Prelude.Maybe Prelude.Text)
audioParameters_sampleRate :: (Maybe Text -> f (Maybe Text))
-> AudioParameters -> f AudioParameters
audioParameters_sampleRate = (AudioParameters -> Maybe Text)
-> (AudioParameters -> Maybe Text -> AudioParameters)
-> Lens AudioParameters AudioParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioParameters' {Maybe Text
sampleRate :: Maybe Text
$sel:sampleRate:AudioParameters' :: AudioParameters -> Maybe Text
sampleRate} -> Maybe Text
sampleRate) (\s :: AudioParameters
s@AudioParameters' {} Maybe Text
a -> AudioParameters
s {$sel:sampleRate:AudioParameters' :: Maybe Text
sampleRate = Maybe Text
a} :: AudioParameters)

-- | The bit rate of the audio stream in the output file, in
-- kilobits\/second. Enter an integer between 64 and 320, inclusive.
audioParameters_bitRate :: Lens.Lens' AudioParameters (Prelude.Maybe Prelude.Text)
audioParameters_bitRate :: (Maybe Text -> f (Maybe Text))
-> AudioParameters -> f AudioParameters
audioParameters_bitRate = (AudioParameters -> Maybe Text)
-> (AudioParameters -> Maybe Text -> AudioParameters)
-> Lens AudioParameters AudioParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioParameters' {Maybe Text
bitRate :: Maybe Text
$sel:bitRate:AudioParameters' :: AudioParameters -> Maybe Text
bitRate} -> Maybe Text
bitRate) (\s :: AudioParameters
s@AudioParameters' {} Maybe Text
a -> AudioParameters
s {$sel:bitRate:AudioParameters' :: Maybe Text
bitRate = Maybe Text
a} :: AudioParameters)

-- | If you specified @AAC@ for @Audio:Codec@, this is the @AAC@ compression
-- profile to use. Valid values include:
--
-- @auto@, @AAC-LC@, @HE-AAC@, @HE-AACv2@
--
-- If you specify @auto@, Elastic Transcoder chooses a profile based on the
-- bit rate of the output file.
audioParameters_codecOptions :: Lens.Lens' AudioParameters (Prelude.Maybe AudioCodecOptions)
audioParameters_codecOptions :: (Maybe AudioCodecOptions -> f (Maybe AudioCodecOptions))
-> AudioParameters -> f AudioParameters
audioParameters_codecOptions = (AudioParameters -> Maybe AudioCodecOptions)
-> (AudioParameters -> Maybe AudioCodecOptions -> AudioParameters)
-> Lens
     AudioParameters
     AudioParameters
     (Maybe AudioCodecOptions)
     (Maybe AudioCodecOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioParameters' {Maybe AudioCodecOptions
codecOptions :: Maybe AudioCodecOptions
$sel:codecOptions:AudioParameters' :: AudioParameters -> Maybe AudioCodecOptions
codecOptions} -> Maybe AudioCodecOptions
codecOptions) (\s :: AudioParameters
s@AudioParameters' {} Maybe AudioCodecOptions
a -> AudioParameters
s {$sel:codecOptions:AudioParameters' :: Maybe AudioCodecOptions
codecOptions = Maybe AudioCodecOptions
a} :: AudioParameters)

instance Core.FromJSON AudioParameters where
  parseJSON :: Value -> Parser AudioParameters
parseJSON =
    String
-> (Object -> Parser AudioParameters)
-> Value
-> Parser AudioParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AudioParameters"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AudioCodecOptions
-> AudioParameters
AudioParameters'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AudioCodecOptions
 -> AudioParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AudioCodecOptions
      -> AudioParameters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Channels")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AudioCodecOptions
   -> AudioParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AudioCodecOptions
      -> AudioParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Codec")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AudioCodecOptions
   -> AudioParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe AudioCodecOptions -> AudioParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AudioPackingMode")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe AudioCodecOptions -> AudioParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe AudioCodecOptions -> AudioParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SampleRate")
            Parser (Maybe Text -> Maybe AudioCodecOptions -> AudioParameters)
-> Parser (Maybe Text)
-> Parser (Maybe AudioCodecOptions -> AudioParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BitRate")
            Parser (Maybe AudioCodecOptions -> AudioParameters)
-> Parser (Maybe AudioCodecOptions) -> Parser AudioParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioCodecOptions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CodecOptions")
      )

instance Prelude.Hashable AudioParameters

instance Prelude.NFData AudioParameters

instance Core.ToJSON AudioParameters where
  toJSON :: AudioParameters -> Value
toJSON AudioParameters' {Maybe Text
Maybe AudioCodecOptions
codecOptions :: Maybe AudioCodecOptions
bitRate :: Maybe Text
sampleRate :: Maybe Text
audioPackingMode :: Maybe Text
codec :: Maybe Text
channels :: Maybe Text
$sel:codecOptions:AudioParameters' :: AudioParameters -> Maybe AudioCodecOptions
$sel:bitRate:AudioParameters' :: AudioParameters -> Maybe Text
$sel:sampleRate:AudioParameters' :: AudioParameters -> Maybe Text
$sel:audioPackingMode:AudioParameters' :: AudioParameters -> Maybe Text
$sel:codec:AudioParameters' :: AudioParameters -> Maybe Text
$sel:channels:AudioParameters' :: AudioParameters -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Channels" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
channels,
            (Text
"Codec" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
codec,
            (Text
"AudioPackingMode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
audioPackingMode,
            (Text
"SampleRate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sampleRate,
            (Text
"BitRate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bitRate,
            (Text
"CodecOptions" Text -> AudioCodecOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AudioCodecOptions -> Pair)
-> Maybe AudioCodecOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioCodecOptions
codecOptions
          ]
      )