gi-gstaudio-1.0.28: GStreamerAudio bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GstAudio.Structs.AudioResampler

Description

AudioResampler is a structure which holds the information required to perform various kinds of resampling filtering.

Since: 1.10

Synopsis

Exported types

newtype AudioResampler Source #

Memory-managed wrapper type.

Constructors

AudioResampler (ManagedPtr AudioResampler) 

Instances

Instances details
Eq AudioResampler Source # 
Instance details

Defined in GI.GstAudio.Structs.AudioResampler

BoxedPtr AudioResampler Source # 
Instance details

Defined in GI.GstAudio.Structs.AudioResampler

ManagedPtrNewtype AudioResampler Source # 
Instance details

Defined in GI.GstAudio.Structs.AudioResampler

Methods

Click to display all available methods, including inherited ones

Expand

Methods

free, resample, reset, update.

Getters

getInFrames, getMaxLatency, getOutFrames.

Setters

None.

free

audioResamplerFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioResampler

resampler: a AudioResampler

-> m () 

Free a previously allocated AudioResampler resampler.

getInFrames

audioResamplerGetInFrames Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioResampler

resampler: a AudioResampler

-> CSize

outFrames: number of input frames

-> m CSize

Returns: The number of input frames needed for producing outFrames of data from resampler.

Get the number of input frames that would currently be needed to produce outFrames from resampler.

getMaxLatency

audioResamplerGetMaxLatency Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioResampler

resampler: a AudioResampler

-> m CSize

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

Get the maximum number of input samples that the resampler would need before producing output.

getOutFrames

audioResamplerGetOutFrames Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioResampler

resampler: a AudioResampler

-> CSize

inFrames: number of input frames

-> m CSize

Returns: The number of frames that would be available after giving inFrames as input to resampler.

Get the number of output frames that would be currently available when inFrames are given to resampler.

new

audioResamplerNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioResamplerMethod

method: a AudioResamplerMethod

-> [AudioResamplerFlags]

flags: AudioResamplerFlags

-> AudioFormat

format: the AudioFormat

-> Int32

channels: the number of channels

-> Int32

inRate: input rate

-> Int32

outRate: output rate

-> Structure

options: extra options

-> m () 

Make a new resampler.

optionsSetQuality

audioResamplerOptionsSetQuality Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioResamplerMethod

method: a AudioResamplerMethod

-> Word32

quality: the quality

-> Int32

inRate: the input rate

-> Int32

outRate: the output rate

-> Structure

options: a Structure

-> m () 

Set the parameters for resampling from inRate to outRate using method for quality in options.

resample

audioResamplerResample Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioResampler

resampler: a AudioResampler

-> Ptr ()

in: input samples

-> CSize

inFrames: number of input frames

-> Ptr ()

out: output samples

-> CSize

outFrames: number of output frames

-> m () 

Perform resampling on inFrames frames in in and write outFrames to out.

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 pushed into the resampler.

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

reset

audioResamplerReset Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioResampler

resampler: a AudioResampler

-> m () 

Reset resampler to the state it was when it was first created, discarding all sample history.

update

audioResamplerUpdate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AudioResampler

resampler: a AudioResampler

-> Int32

inRate: new input rate

-> Int32

outRate: new output rate

-> Structure

options: new options or Nothing

-> m Bool

Returns: True if the new parameters could be set

Update the resampler parameters for resampler. This function should not be called concurrently with any other function on resampler.

When inRate or outRate is 0, its value is unchanged.

When options is Nothing, the previously configured options are reused.