gi-gstaudio-1.0.12: GStreamerAudio bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GstAudio.Structs.AudioConverter

Contents

Description

 

Synopsis

Exported types

newtype AudioConverter Source #

Instances

WrappedPtr AudioConverter Source # 
((~) * info (ResolveAudioConverterMethod t AudioConverter), MethodInfo * info AudioConverter p) => IsLabel t (AudioConverter -> p) Source # 

Methods

fromLabel :: Proxy# Symbol t -> AudioConverter -> p #

((~) * info (ResolveAudioConverterMethod t AudioConverter), MethodInfo * info AudioConverter p) => IsLabelProxy t (AudioConverter -> p) Source # 
HasAttributeList * AudioConverter Source # 
((~) * signature (Int32 -> Int32 -> Maybe Structure -> m Bool), MonadIO m) => MethodInfo * AudioConverterUpdateConfigMethodInfo AudioConverter signature Source # 
((~) * signature ([AudioConverterFlags] -> Ptr () -> Word64 -> Ptr () -> Word64 -> m Bool), MonadIO m) => MethodInfo * AudioConverterSamplesMethodInfo AudioConverter signature Source # 
((~) * signature (m ()), MonadIO m) => MethodInfo * AudioConverterResetMethodInfo AudioConverter signature Source # 
((~) * signature (Word64 -> m Word64), MonadIO m) => MethodInfo * AudioConverterGetOutFramesMethodInfo AudioConverter signature Source # 
((~) * signature (m Word64), MonadIO m) => MethodInfo * AudioConverterGetMaxLatencyMethodInfo AudioConverter signature Source # 
((~) * signature (Word64 -> m Word64), MonadIO m) => MethodInfo * AudioConverterGetInFramesMethodInfo AudioConverter signature Source # 
((~) * signature (Int32 -> Int32 -> m Structure), MonadIO m) => MethodInfo * AudioConverterGetConfigMethodInfo AudioConverter signature Source # 
((~) * signature (m ()), MonadIO m) => MethodInfo * AudioConverterFreeMethodInfo AudioConverter signature Source # 
type AttributeList AudioConverter Source # 

Methods

free

audioConverterFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioConverter

convert: a AudioConverter

-> m () 

Free a previously allocated convert instance.

getConfig

audioConverterGetConfig Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioConverter

convert: a AudioConverter

-> Int32

inRate: result input rate

-> Int32

outRate: result output rate

-> m Structure

Returns: a Structure that remains valid for as long as convert is valid or until audioConverterUpdateConfig is called.

Get the current configuration of convert.

getInFrames

audioConverterGetInFrames Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioConverter

convert: a AudioConverter

-> Word64

outFrames: number of output frames

-> m Word64

Returns: the number of input frames

Calculate how many input frames are currently needed by convert to produce outFrames of output frames.

getMaxLatency

audioConverterGetMaxLatency Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioConverter

convert: a AudioConverter

-> m Word64

Returns: the latency of convert as expressed in the number of frames.

Get the maximum number of input frames that the converter would need before producing output.

getOutFrames

audioConverterGetOutFrames Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioConverter

convert: a AudioConverter

-> Word64

inFrames: number of input frames

-> m Word64

Returns: the number of output frames

Calculate how many output frames can be produced when inFrames input frames are given to convert.

reset

audioConverterReset Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioConverter

convert: a AudioConverter

-> m () 

Reset convert to the state it was when it was first created, clearing any history it might currently have.

samples

audioConverterSamples Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioConverter

convert: a AudioConverter

-> [AudioConverterFlags]

flags: extra AudioConverterFlags

-> Ptr ()

in: input frames

-> Word64

inFrames: number of input frames

-> Ptr ()

out: output frames

-> Word64

outFrames: number of output frames

-> m Bool

Returns: True is the conversion could be performed.

Perform the conversion with inFrames in in to outFrames in out using convert.

In case the samples are interleaved, in and out must point to an array with a single element pointing to a block of interleaved samples.

If non-interleaved samples are used, in and out must point to an array with pointers to memory blocks, one for each channel.

in may be Nothing, in which case inFrames of silence samples are processed by the converter.

This function always produces outFrames of output and consumes inFrames of input. Use audioConverterGetOutFrames and audioConverterGetInFrames to make sure inFrames and outFrames are matching and in and out point to enough memory.

updateConfig

audioConverterUpdateConfig Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioConverter

convert: a AudioConverter

-> Int32

inRate: input rate

-> Int32

outRate: output rate

-> Maybe Structure

config: a Structure or Nothing

-> m Bool

Returns: True when the new parameters could be set

Set inRate, outRate and config as extra configuration for convert.

inRate and outRate specify the new sample rates of input and output formats. A value of 0 leaves the sample rate unchanged.

config can be Nothing, in which case, the current configuration is not changed.

If the parameters in config can not be set exactly, this function returns False and will try to update as much state as possible. The new state can then be retrieved and refined with audioConverterGetConfig.

Look at the GST_AUDIO_CONVERTER_OPT_* fields to check valid configuration option and values.