Documentation
¶
Overview ¶
Use of this source code is governed by a MIT license that can be found in the LICENSE file. by Giorgis (habtom@giorgis.io)
The process of changing the sampling rate of a discrete signal to obtain a new discrete representation of the underlying continuous signal. resampler provides a high-level interface to the libswresample library audio resampling utilities
Index ¶
- func Swr_close(s *SwrContext)
- func Swr_config_frame(s *SwrContext, o, i *AVFrame) int
- func Swr_convert(s *SwrContext, out **uint8, oc int, in **uint8, ic int) int
- func Swr_convert_frame(s *SwrContext, o, i *AVFrame) int
- func Swr_drop_output(s *SwrContext, c int) int
- func Swr_free(s **SwrContext)
- func Swr_get_delay(s *SwrContext, b int64) int64
- func Swr_init(s *SwrContext) int
- func Swr_inject_silence(s *SwrContext, c int) int
- func Swr_is_initialized(s *SwrContext) int
- func Swr_next_pts(s *SwrContext, pts int64) int64
- func Swr_set_channel_mapping(s *SwrContext, cm *int) int
- func Swr_set_compensation(s *SwrContext, sd, cd int) int
- func Swr_set_matrix(s *SwrContext, m *int, t int) int
- func Swresample_configuration() string
- func Swresample_license() string
- func Swresample_version() uint
- type AVClass
- type AVFrame
- type AVSampleFormat
- type SwrContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Swr_close ¶
func Swr_close(s *SwrContext)
void swr_close (struct SwrContext *s) Closes the context so that swr_is_initialized() returns 0.
func Swr_config_frame ¶
func Swr_config_frame(s *SwrContext, o, i *AVFrame) int
int swr_config_frame (SwrContext *swr, const AVFrame *out, const AVFrame *in) Configure or reconfigure the SwrContext using the information provided by the AVFrames.
func Swr_convert ¶
Core conversion functions int swr_convert (struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in, int in_count) Convert audio.
func Swr_convert_frame ¶
func Swr_convert_frame(s *SwrContext, o, i *AVFrame) int
AVFrame based API int swr_convert_frame (SwrContext *swr, AVFrame *output, const AVFrame *input) Convert the samples in the input AVFrame and write them to the output AVFrame.
func Swr_drop_output ¶
func Swr_drop_output(s *SwrContext, c int) int
Sample handling functions int swr_drop_output (struct SwrContext *s, int count) Drops the specified number of output samples.
func Swr_free ¶
func Swr_free(s **SwrContext)
SwrContext destructor functions void swr_free (struct SwrContext **s) Free the given SwrContext and set the pointer to NULL.
func Swr_get_delay ¶
func Swr_get_delay(s *SwrContext, b int64) int64
int64_t swr_get_delay (struct SwrContext *s, int64_t base) Gets the delay the next input sample will experience relative to the next output sample.
func Swr_init ¶
func Swr_init(s *SwrContext) int
int swr_init (struct SwrContext *s) Initialize context after user parameters have been set.
func Swr_inject_silence ¶
func Swr_inject_silence(s *SwrContext, c int) int
int swr_inject_silence (struct SwrContext *s, int count) Injects the specified number of silence samples.
func Swr_is_initialized ¶
func Swr_is_initialized(s *SwrContext) int
int swr_is_initialized (struct SwrContext *s) Check whether an swr context has been initialized or not.
func Swr_next_pts ¶
func Swr_next_pts(s *SwrContext, pts int64) int64
int64_t swr_next_pts (struct SwrContext *s, int64_t pts) Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate) units.
func Swr_set_channel_mapping ¶
func Swr_set_channel_mapping(s *SwrContext, cm *int) int
int swr_set_channel_mapping (struct SwrContext *s, const int *channel_map) Set a customized input channel mapping.
func Swr_set_compensation ¶
func Swr_set_compensation(s *SwrContext, sd, cd int) int
Low-level option setting functions These functons provide a means to set low-level options that is not possible with the AVOption API. int swr_set_compensation (struct SwrContext *s, int sample_delta, int compensation_distance) Activate resampling compensation ("soft" compensation).
func Swr_set_matrix ¶
func Swr_set_matrix(s *SwrContext, m *int, t int) int
int swr_set_matrix (struct SwrContext *s, const double *matrix, int stride) Set a customized remix matrix.
func Swresample_configuration ¶
func Swresample_configuration() string
const char * swresample_configuration (void) Return the swr build-time configuration.
func Swresample_license ¶
func Swresample_license() string
const char * swresample_license (void) Return the swr license.
func Swresample_version ¶
func Swresample_version() uint
Configuration accessors unsigned swresample_version (void) Return the LIBSWRESAMPLE_VERSION_INT constant.
Types ¶
type AVClass ¶
type AVClass C.struct_AVClass
func Swr_get_class ¶
func Swr_get_class() *AVClass
const AVClass * swr_get_class (void) Get the AVClass for SwrContext.
type AVFrame ¶
type AVFrame C.struct_AVFrame
type AVSampleFormat ¶
type AVSampleFormat C.enum_AVSampleFormat
type SwrContext ¶
type SwrContext C.struct_SwrContext
func Swr_alloc ¶
func Swr_alloc() *SwrContext
SwrContext constructor functions struct SwrContext * swr_alloc (void) Allocate SwrContext.
func Swr_alloc_set_opts ¶
func Swr_alloc_set_opts(s *SwrContext, ocl int64, osf AVSampleFormat, osr int, icl int64, isf AVSampleFormat, isr, lo, lc int) *SwrContext
struct SwrContext * swr_alloc_set_opts (struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx) Allocate SwrContext if needed and set/reset common parameters.