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 |
AudioResampler
is a structure which holds the information
required to perform various kinds of resampling filtering.
- newtype AudioResampler = AudioResampler (ManagedPtr AudioResampler)
- noAudioResampler :: Maybe AudioResampler
- data AudioResamplerFreeMethodInfo
- audioResamplerFree :: (HasCallStack, MonadIO m) => AudioResampler -> m ()
- data AudioResamplerGetInFramesMethodInfo
- audioResamplerGetInFrames :: (HasCallStack, MonadIO m) => AudioResampler -> Word64 -> m Word64
- data AudioResamplerGetMaxLatencyMethodInfo
- audioResamplerGetMaxLatency :: (HasCallStack, MonadIO m) => AudioResampler -> m Word64
- data AudioResamplerGetOutFramesMethodInfo
- audioResamplerGetOutFrames :: (HasCallStack, MonadIO m) => AudioResampler -> Word64 -> m Word64
- audioResamplerNew :: (HasCallStack, MonadIO m) => AudioResamplerMethod -> [AudioResamplerFlags] -> AudioFormat -> Int32 -> Int32 -> Int32 -> Structure -> m ()
- audioResamplerOptionsSetQuality :: (HasCallStack, MonadIO m) => AudioResamplerMethod -> Word32 -> Int32 -> Int32 -> Structure -> m ()
- data AudioResamplerResampleMethodInfo
- audioResamplerResample :: (HasCallStack, MonadIO m) => AudioResampler -> Ptr () -> Word64 -> Ptr () -> Word64 -> m ()
- data AudioResamplerResetMethodInfo
- audioResamplerReset :: (HasCallStack, MonadIO m) => AudioResampler -> m ()
- data AudioResamplerUpdateMethodInfo
- audioResamplerUpdate :: (HasCallStack, MonadIO m) => AudioResampler -> Int32 -> Int32 -> Structure -> m Bool
Exported types
newtype AudioResampler Source #
Methods
free
data AudioResamplerFreeMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * AudioResamplerFreeMethodInfo AudioResampler signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> m () |
Free a previously allocated AudioResampler
resampler
.
Since: 1.6
getInFrames
data AudioResamplerGetInFramesMethodInfo Source #
((~) * signature (Word64 -> m Word64), MonadIO m) => MethodInfo * AudioResamplerGetInFramesMethodInfo AudioResampler signature Source # | |
audioResamplerGetInFrames Source #
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> Word64 |
|
-> m Word64 | 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
data AudioResamplerGetMaxLatencyMethodInfo Source #
((~) * signature (m Word64), MonadIO m) => MethodInfo * AudioResamplerGetMaxLatencyMethodInfo AudioResampler signature Source # | |
audioResamplerGetMaxLatency Source #
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> m Word64 | Returns: the latency of |
Get the maximum number of input samples that the resampler would need before producing output.
getOutFrames
data AudioResamplerGetOutFramesMethodInfo Source #
((~) * signature (Word64 -> m Word64), MonadIO m) => MethodInfo * AudioResamplerGetOutFramesMethodInfo AudioResampler signature Source # | |
audioResamplerGetOutFrames Source #
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> Word64 |
|
-> m Word64 | Returns: The number of frames that would be availabe 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
data AudioResamplerResampleMethodInfo Source #
((~) * signature (Ptr () -> Word64 -> Ptr () -> Word64 -> m ()), MonadIO m) => MethodInfo * AudioResamplerResampleMethodInfo AudioResampler signature Source # | |
audioResamplerResample Source #
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> Ptr () |
|
-> Word64 |
|
-> Ptr () |
|
-> Word64 |
|
-> 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
data AudioResamplerResetMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * AudioResamplerResetMethodInfo AudioResampler signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> AudioResampler |
|
-> m () |
Reset resampler
to the state it was when it was first created, discarding
all sample history.
update
data AudioResamplerUpdateMethodInfo Source #
((~) * signature (Int32 -> Int32 -> Structure -> m Bool), MonadIO m) => MethodInfo * AudioResamplerUpdateMethodInfo AudioResampler signature Source # | |
:: (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.