|
LMMS
|
audio-decoder - wrapper around libsndfile and libav* More...
#include <stddef.h>#include <stdint.h>#include <sys/types.h>Go to the source code of this file.
Classes | |
| struct | adinfo |
Functions | |
| void * | ad_open (const char *fn, struct adinfo *nfo) |
| int | ad_close (void *sf) |
| int64_t | ad_seek (void *sf, int64_t pos) |
| ssize_t | ad_read (void *sf, float *out, size_t len) |
| int | ad_get_bitrate (void *sf) |
| int | ad_info (void *sf, struct adinfo *nfo) |
| void | ad_clear_nfo (struct adinfo *nfo) |
| void | ad_free_nfo (struct adinfo *nfo) |
| int | ad_finfo (const char *, struct adinfo *) |
| ssize_t | ad_read_mono_dbl (void *, struct adinfo *, double *, size_t) |
| void | ad_dump_nfo (int dbglvl, struct adinfo *nfo) |
| void | ad_set_debuglevel (int lvl) |
audio-decoder - wrapper around libsndfile and libav*
Copyright (C) 2011-2013 Robin Gareus robin.nosp@m.@gar.nosp@m.eus.o.nosp@m.rg Copyright (C) 2014-2023 Filipe Coelho falkt.nosp@m.x@fa.nosp@m.lktx..nosp@m.com
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 2.1, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
zero initialize the information struct. * (does not free nfo->meta_data)
| nfo | pointer to a adinfo struct |
close an audio file and release decoder structures
| sf | decoder handle |
calls dbg() to print file info to stderr.
| dbglvl | |
| nfo |
read file info combines ad_open() and ad_close()
free possibly allocated meta-data text
| nfo | pointer to a adinfo struct |
get the current playing bit_rate
| sf | decoder handle |
re-read the file information and meta-data.
this is not neccesary in general ad_open includes an inplicit call but meta-data may change in live-stream in which case en explicit call to ad_into is needed to update the inforation
| fn | file-name |
| nfo | pointer to a adinfo struct which will hold information about the file. |
open an audio file
| fn | file-name |
| nfo | pointer to a adinfo struct which will hold information about the file. |
| ssize_t ad_read | ( | void * | sf, |
| float * | out, | ||
| size_t | len ) |
decode audio data chunk to raw interleaved channel floating point data
| sf | decoder handle |
| out | place to store data – must be large enough to hold (sizeof(float) * len) bytes. |
| len | number of samples (!) to read (should be a multiple of nfo->channels). |
wrapper around ad_read, downmixes all channels to mono
| int64_t ad_seek | ( | void * | sf, |
| int64_t | pos ) |
seel to a given position in the file
| sf | decoder handle |
| pos | frame position to seek to in frames (1 frame = number-of-channel samples) from the start of the file. |