Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
AudioResampler
is a structure which holds the information
required to perform various kinds of resampling filtering.
Since: 1.10
Synopsis
- newtype AudioResampler = AudioResampler (ManagedPtr AudioResampler)
- audioResamplerFree :: (HasCallStack, MonadIO m) => AudioResampler -> m ()
- audioResamplerGetInFrames :: (HasCallStack, MonadIO m) => AudioResampler -> CSize -> m CSize
- audioResamplerGetMaxLatency :: (HasCallStack, MonadIO m) => AudioResampler -> m CSize
- audioResamplerGetOutFrames :: (HasCallStack, MonadIO m) => AudioResampler -> CSize -> m CSize
- audioResamplerNew :: (HasCallStack, MonadIO m) => AudioResamplerMethod -> [AudioResamplerFlags] -> AudioFormat -> Int32 -> Int32 -> Int32 -> Structure -> m ()
- audioResamplerOptionsSetQuality :: (HasCallStack, MonadIO m) => AudioResamplerMethod -> Word32 -> Int32 -> Int32 -> Structure -> m ()
- audioResamplerResample :: (HasCallStack, MonadIO m) => AudioResampler -> Ptr () -> CSize -> Ptr () -> CSize -> m ()
- audioResamplerReset :: (HasCallStack, MonadIO m) => AudioResampler -> m ()
- audioResamplerUpdate :: (HasCallStack, MonadIO m) => AudioResampler -> Int32 -> Int32 -> Structure -> m Bool
Exported types
newtype AudioResampler Source #
Memory-managed wrapper type.
AudioResampler (ManagedPtr AudioResampler) |
Instances
Eq AudioResampler Source # | |
Defined in GI.GstAudio.Structs.AudioResampler (==) :: AudioResampler -> AudioResampler -> Bool # (/=) :: AudioResampler -> AudioResampler -> Bool # | |
BoxedPtr AudioResampler Source # | |
Defined in GI.GstAudio.Structs.AudioResampler boxedPtrCopy :: AudioResampler -> IO AudioResampler boxedPtrFree :: AudioResampler -> IO () | |
ManagedPtrNewtype AudioResampler Source # | |
Defined in GI.GstAudio.Structs.AudioResampler toManagedPtr :: AudioResampler -> ManagedPtr AudioResampler |
Methods
Click to display all available methods, including inherited ones
free
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> m () |
Free a previously allocated AudioResampler
resampler
.
getInFrames
audioResamplerGetInFrames Source #
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> CSize |
|
-> m CSize | Returns: The number of input frames needed for producing
|
Get the number of input frames that would currently be needed
to produce outFrames
from resampler
.
getMaxLatency
audioResamplerGetMaxLatency Source #
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> m CSize | Returns: the latency of |
Get the maximum number of input samples that the resampler would need before producing output.
getOutFrames
audioResamplerGetOutFrames Source #
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> CSize |
|
-> m CSize | Returns: The number of frames that would be available after giving
|
Get the number of output frames that would be currently available when
inFrames
are given to resampler
.
new
:: (HasCallStack, MonadIO m) | |
=> AudioResamplerMethod |
|
-> [AudioResamplerFlags] |
|
-> AudioFormat |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Structure |
|
-> m () |
Make a new resampler.
optionsSetQuality
audioResamplerOptionsSetQuality Source #
:: (HasCallStack, MonadIO m) | |
=> AudioResamplerMethod |
|
-> Word32 |
|
-> Int32 |
|
-> Int32 |
|
-> Structure |
|
-> m () |
Set the parameters for resampling from inRate
to outRate
using method
for quality
in options
.
resample
audioResamplerResample Source #
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> Ptr () |
|
-> CSize |
|
-> Ptr () |
|
-> CSize |
|
-> 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
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> m () |
Reset resampler
to the state it was when it was first created, discarding
all sample history.
update
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> Int32 |
|
-> Int32 |
|
-> Structure |
|
-> m Bool | Returns: |
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.