src/pcm_resample.h File Reference
#include "check.h"
#include "pcm_buffer.h"
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures |
struct | pcm_resample_state |
| This object is statically allocated (within another struct), and holds buffer allocations and the state for the resampler. More...
|
Functions |
bool | pcm_resample_global_init (GError **error_r) |
void | pcm_resample_init (struct pcm_resample_state *state) |
| Initializes a pcm_resample_state object.
|
void | pcm_resample_deinit (struct pcm_resample_state *state) |
| Deinitializes a pcm_resample_state object and frees allocated memory.
|
void | pcm_resample_reset (struct pcm_resample_state *state) |
const float * | pcm_resample_float (struct pcm_resample_state *state, unsigned channels, unsigned src_rate, const float *src_buffer, size_t src_size, unsigned dest_rate, size_t *dest_size_r, GError **error_r) |
| Resamples 32 bit float data.
|
const int16_t * | pcm_resample_16 (struct pcm_resample_state *state, unsigned channels, unsigned src_rate, const int16_t *src_buffer, size_t src_size, unsigned dest_rate, size_t *dest_size_r, GError **error_r) |
| Resamples 16 bit PCM data.
|
const int32_t * | pcm_resample_32 (struct pcm_resample_state *state, unsigned channels, unsigned src_rate, const int32_t *src_buffer, size_t src_size, unsigned dest_rate, size_t *dest_size_r, GError **error_r) |
| Resamples 32 bit PCM data.
|
static const int32_t * | pcm_resample_24 (struct pcm_resample_state *state, unsigned channels, unsigned src_rate, const int32_t *src_buffer, size_t src_size, unsigned dest_rate, size_t *dest_size_r, GError **error_r) |
| Resamples 24 bit PCM data.
|
Function Documentation
const int16_t* pcm_resample_16 |
( |
struct pcm_resample_state * |
state, |
|
|
unsigned |
channels, |
|
|
unsigned |
src_rate, |
|
|
const int16_t * |
src_buffer, |
|
|
size_t |
src_size, |
|
|
unsigned |
dest_rate, |
|
|
size_t * |
dest_size_r, |
|
|
GError ** |
error_r | |
|
) |
| | |
Resamples 16 bit PCM data.
- Parameters:
-
| state | an initialized pcm_resample_state object |
| channels | the number of channels |
| src_rate | the source sample rate |
| src | the source PCM buffer |
| src_size | the size of src in bytes |
| dest_rate | the requested destination sample rate |
| dest_size_r | returns the number of bytes of the destination buffer |
- Returns:
- the destination buffer
static const int32_t* pcm_resample_24 |
( |
struct pcm_resample_state * |
state, |
|
|
unsigned |
channels, |
|
|
unsigned |
src_rate, |
|
|
const int32_t * |
src_buffer, |
|
|
size_t |
src_size, |
|
|
unsigned |
dest_rate, |
|
|
size_t * |
dest_size_r, |
|
|
GError ** |
error_r | |
|
) |
| | [inline, static] |
Resamples 24 bit PCM data.
- Parameters:
-
| state | an initialized pcm_resample_state object |
| channels | the number of channels |
| src_rate | the source sample rate |
| src | the source PCM buffer |
| src_size | the size of src in bytes |
| dest_rate | the requested destination sample rate |
| dest_size_r | returns the number of bytes of the destination buffer |
- Returns:
- the destination buffer
Definition at line 150 of file pcm_resample.h.
const int32_t* pcm_resample_32 |
( |
struct pcm_resample_state * |
state, |
|
|
unsigned |
channels, |
|
|
unsigned |
src_rate, |
|
|
const int32_t * |
src_buffer, |
|
|
size_t |
src_size, |
|
|
unsigned |
dest_rate, |
|
|
size_t * |
dest_size_r, |
|
|
GError ** |
error_r | |
|
) |
| | |
Resamples 32 bit PCM data.
- Parameters:
-
| state | an initialized pcm_resample_state object |
| channels | the number of channels |
| src_rate | the source sample rate |
| src | the source PCM buffer |
| src_size | the size of src in bytes |
| dest_rate | the requested destination sample rate |
| dest_size_r | returns the number of bytes of the destination buffer |
- Returns:
- the destination buffer
const float* pcm_resample_float |
( |
struct pcm_resample_state * |
state, |
|
|
unsigned |
channels, |
|
|
unsigned |
src_rate, |
|
|
const float * |
src_buffer, |
|
|
size_t |
src_size, |
|
|
unsigned |
dest_rate, |
|
|
size_t * |
dest_size_r, |
|
|
GError ** |
error_r | |
|
) |
| | |
Resamples 32 bit float data.
- Parameters:
-
| state | an initialized pcm_resample_state object |
| channels | the number of channels |
| src_rate | the source sample rate |
| src | the source PCM buffer |
| src_size | the size of src in bytes |
| dest_rate | the requested destination sample rate |
| dest_size_r | returns the number of bytes of the destination buffer |
- Returns:
- the destination buffer
bool pcm_resample_global_init |
( |
GError ** |
error_r |
) |
|