| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GstAudio.Structs.AudioConverter
Contents
Description
- newtype AudioConverter = AudioConverter (ManagedPtr AudioConverter)
- noAudioConverter :: Maybe AudioConverter
- audioConverterFree :: (HasCallStack, MonadIO m) => AudioConverter -> m ()
- audioConverterGetConfig :: (HasCallStack, MonadIO m) => AudioConverter -> Int32 -> Int32 -> m Structure
- audioConverterGetInFrames :: (HasCallStack, MonadIO m) => AudioConverter -> Word64 -> m Word64
- audioConverterGetMaxLatency :: (HasCallStack, MonadIO m) => AudioConverter -> m Word64
- audioConverterGetOutFrames :: (HasCallStack, MonadIO m) => AudioConverter -> Word64 -> m Word64
- audioConverterReset :: (HasCallStack, MonadIO m) => AudioConverter -> m ()
- audioConverterSamples :: (HasCallStack, MonadIO m) => AudioConverter -> [AudioConverterFlags] -> Ptr () -> Word64 -> Ptr () -> Word64 -> m Bool
- audioConverterSupportsInplace :: (HasCallStack, MonadIO m) => AudioConverter -> m Bool
- audioConverterUpdateConfig :: (HasCallStack, MonadIO m) => AudioConverter -> Int32 -> Int32 -> Maybe Structure -> m Bool
Exported types
Methods
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => AudioConverter |
|
| -> m () |
Free a previously allocated convert instance.
getConfig
audioConverterGetConfig Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => AudioConverter |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m Structure | Returns: a |
Get the current configuration of convert.
getInFrames
audioConverterGetInFrames Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => AudioConverter |
|
| -> Word64 |
|
| -> 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 |
|
| -> m Word64 | Returns: the latency of |
Get the maximum number of input frames that the converter would need before producing output.
getOutFrames
audioConverterGetOutFrames Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => AudioConverter |
|
| -> Word64 |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m) | |
| => 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 |
|
| -> [AudioConverterFlags] |
|
| -> Ptr () |
|
| -> Word64 |
|
| -> Ptr () |
|
| -> Word64 |
|
| -> m Bool | Returns: |
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.
supportsInplace
audioConverterSupportsInplace Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => AudioConverter |
|
| -> m Bool | Returns: |
Returns whether the audio converter can perform the conversion in-place.
The return value would be typically input to baseTransformSetInPlace
updateConfig
audioConverterUpdateConfig Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => AudioConverter |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Maybe Structure | |
| -> m Bool | Returns: |
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.