{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticTranscoder.Types.AudioParameters where

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

-- | Parameters required for transcoding audio.
--
-- /See:/ 'newAudioParameters' smart constructor.
data AudioParameters = 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 -> Maybe Text
audioPackingMode :: 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,
    -- | 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,
    -- | 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,
    -- | 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
  }
  deriving (AudioParameters -> AudioParameters -> Bool
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]
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
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. 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:
--
-- '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
--
-- '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.
--
-- '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@.
--
-- '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.
--
-- '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.
newAudioParameters ::
  AudioParameters
newAudioParameters :: AudioParameters
newAudioParameters =
  AudioParameters'
    { $sel:audioPackingMode:AudioParameters' :: Maybe Text
audioPackingMode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:bitRate:AudioParameters' :: Maybe Text
bitRate = forall a. Maybe a
Prelude.Nothing,
      $sel:channels:AudioParameters' :: Maybe Text
channels = forall a. Maybe a
Prelude.Nothing,
      $sel:codec:AudioParameters' :: Maybe Text
codec = forall a. Maybe a
Prelude.Nothing,
      $sel:codecOptions:AudioParameters' :: Maybe AudioCodecOptions
codecOptions = forall a. Maybe a
Prelude.Nothing,
      $sel:sampleRate:AudioParameters' :: Maybe Text
sampleRate = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' AudioParameters (Maybe Text)
audioParameters_audioPackingMode = 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 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 :: Lens' AudioParameters (Maybe Text)
audioParameters_bitRate = 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)

-- | 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 :: Lens' AudioParameters (Maybe Text)
audioParameters_channels = 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 :: Lens' AudioParameters (Maybe Text)
audioParameters_codec = 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)

-- | 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 :: Lens' AudioParameters (Maybe AudioCodecOptions)
audioParameters_codecOptions = 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)

-- | 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 :: Lens' AudioParameters (Maybe Text)
audioParameters_sampleRate = 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)

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

instance Prelude.Hashable AudioParameters where
  hashWithSalt :: Int -> AudioParameters -> Int
hashWithSalt Int
_salt AudioParameters' {Maybe Text
Maybe AudioCodecOptions
sampleRate :: Maybe Text
codecOptions :: Maybe AudioCodecOptions
codec :: Maybe Text
channels :: Maybe Text
bitRate :: Maybe Text
audioPackingMode :: Maybe Text
$sel:sampleRate:AudioParameters' :: AudioParameters -> Maybe Text
$sel:codecOptions:AudioParameters' :: AudioParameters -> Maybe AudioCodecOptions
$sel:codec:AudioParameters' :: AudioParameters -> Maybe Text
$sel:channels:AudioParameters' :: AudioParameters -> Maybe Text
$sel:bitRate:AudioParameters' :: AudioParameters -> Maybe Text
$sel:audioPackingMode:AudioParameters' :: AudioParameters -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
audioPackingMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bitRate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
channels
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
codec
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioCodecOptions
codecOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sampleRate

instance Prelude.NFData AudioParameters where
  rnf :: AudioParameters -> ()
rnf AudioParameters' {Maybe Text
Maybe AudioCodecOptions
sampleRate :: Maybe Text
codecOptions :: Maybe AudioCodecOptions
codec :: Maybe Text
channels :: Maybe Text
bitRate :: Maybe Text
audioPackingMode :: Maybe Text
$sel:sampleRate:AudioParameters' :: AudioParameters -> Maybe Text
$sel:codecOptions:AudioParameters' :: AudioParameters -> Maybe AudioCodecOptions
$sel:codec:AudioParameters' :: AudioParameters -> Maybe Text
$sel:channels:AudioParameters' :: AudioParameters -> Maybe Text
$sel:bitRate:AudioParameters' :: AudioParameters -> Maybe Text
$sel:audioPackingMode:AudioParameters' :: AudioParameters -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
audioPackingMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bitRate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
channels
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
codec
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioCodecOptions
codecOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sampleRate

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