LiVES
3.2.0
|
Go to the source code of this file.
Data Structures | |
struct | aserver_message_t |
struct | lives_audio_buf_t |
Macros | |
#define | SAMPLE_MAX_16BIT_P 32767.4999999f |
#define | SAMPLE_MAX_16BIT_N 32768.0f |
#define | SAMPLE_MAX_16BITI 32768 |
#define | SWAP_U_TO_S 1 |
sign swapping More... | |
#define | SWAP_S_TO_U 2 |
signed to unsigned More... | |
#define | SWAP_X_TO_L 1 |
endian swapping More... | |
#define | SWAP_L_TO_X 2 |
local to other More... | |
#define | DEFAULT_AUDIO_RATE 44100 |
defaults for when not specifed More... | |
#define | DEFAULT_AUDIO_CHANS 2 |
#define | DEFAULT_AUDIO_SAMPS 16 |
#define | DEFAULT_AUDIO_SIGNED8 (AFORM_UNSIGNED) |
#define | DEFAULT_AUDIO_SIGNED16 (!AFORM_UNSIGNED) |
#define | MAX_ACHANS 2 |
max number of player channels More... | |
#define | NSTOREDFDS 64 |
#define | MAX_AUDIO_MEM 32 * 1024 * 1024 |
TODO ** - make configurable - audio buffer size for rendering. More... | |
#define | RENDER_BLOCK_SIZE 1024 |
chunk size for interpolate/effect cycle More... | |
#define | SILENCE_BLOCK_SIZE BUFFER_FILL_BYTES_LARGE |
size of silent block in bytes More... | |
#define | XSAMPLES 393216 |
buffer size (output samples) for (semi) realtime audio (bytes == XSAMPLES * achans * samp. size) this is shared across prefs->num_rtaudiobufs buffers (default 4) used when we have an event_list (i.e multitrack or previewing a recording in CE) More... | |
#define | AUD_WRITE_CHECK 0xFFFFFFFFF4000000 |
after recording this many bytes we check disk space (default 128MB) More... | |
#define | WEED_LEAF_HOST_KEEP_ADATA "keep_adata" |
#define | ASERVER_CMD_PROCESSED 0 |
asynch msging More... | |
#define | ASERVER_CMD_FILE_OPEN 1 |
#define | ASERVER_CMD_FILE_CLOSE 2 |
#define | ASERVER_CMD_FILE_SEEK 3 |
#define | is_realtime_aplayer(ptype) ((ptype == AUD_PLAYER_JACK || ptype == AUD_PLAYER_PULSE || ptype == AUD_PLAYER_NONE)) |
#define | lives_vol_from_linear(vol) ((float)squared(squared((vol)))) |
#define | lives_vol_to_linear(vol) (sqrtf(sqrtf((vol)))) |
Enumerations | |
enum | lives_operation_t { LIVES_NOP_OPERATION = 0, LIVES_READ_OPERATION, LIVES_WRITE_OPERATION, LIVES_CONVERT_OPERATION } |
enum | lives_audio_loop_t { AUDIO_LOOP_NONE, AUDIO_LOOP_FORWARD, AUDIO_LOOP_PINGPONG } |
enum | lives_rec_audio_type_t { RECA_MONITOR = 0, RECA_WINDOW_GRAB, RECA_NEW_CLIP, RECA_EXISTING, RECA_EXTERNAL, RECA_GENERATED } |
Functions | |
float | get_float_audio_val_at_time (int fnum, int afd, double secs, int chnum, int chans) GNU_HOT |
float | audiofile_get_maxvol (int fnum, double start, double end, float thresh) |
boolean | normalise_audio (int fnum, double start, double end, float thresh) |
void | sample_silence_dS (float *dst, uint64_t nsamples) |
void | sample_silence_stream (int nchans, int64_t nframes) |
boolean | pad_with_silence (int out_fd, void *buff, off64_t oins_size, int64_t ins_size, int asamps, int aunsigned, boolean big_endian) |
void | sample_move_d8_d16 (short *dst, uint8_t *src, uint64_t nsamples, size_t tbytes, double scale, int nDstChannels, int nSrcChannels, int swap_sign) GNU_HOT |
void | sample_move_d16_d16 (short *dst, short *src, uint64_t nsamples, size_t tbytes, double scale, int nDstChannels, int nSrcChannels, int swap_endian, int swap_sign) GNU_HOT |
void | sample_move_d16_d8 (uint8_t *dst, short *src, uint64_t nsamples, size_t tbytes, double scale, int nDstChannels, int nSrcChannels, int swap_sign) GNU_HOT |
convert from any number of source channels to any number of destination channels - 8 bit output More... | |
float | sample_move_d16_float (float *dst, short *src, uint64_t nsamples, uint64_t src_skip, int is_unsigned, boolean rev_endian, float vol) GNU_HOT |
int64_t | sample_move_float_int (void *holding_buff, float **float_buffer, int nsamps, double scale, int chans, int asamps, int usigned, boolean swap_endian, boolean float_interleaved, float vol) GNU_HOT |
returns frames output More... | |
int64_t | sample_move_abuf_float (float **obuf, int nchans, int nsamps, int out_arate, float vol) GNU_HOT |
copy audio data from cache into audio sound buffer More... | |
int64_t | sample_move_abuf_int16 (short *obuf, int nchans, int nsamps, int out_arate) GNU_HOT |
copy audio data from cache into audio sound buffer More... | |
void | sample_move_float_float (float *dst, float *src, uint64_t nsamples, double scale, int dst_skip) GNU_HOT |
boolean | float_deinterleave (float *fbuffer, int nsamps, int nchans) GNU_HOT |
boolean | float_interleave (float *fbuffer, int nsamps, int nchans) GNU_HOT |
int64_t | render_audio_segment (int nfiles, int *from_files, int to_file, double *avels, double *fromtime, ticks_t tc_start, ticks_t tc_end, double *chvol, double opvol_start, double opvol_end, lives_audio_buf_t *obuf) |
void | aud_fade (int fileno, double startt, double endt, double startv, double endv) |
fade in/fade out More... | |
boolean | adjust_clip_volume (int fileno, float newvol, boolean make_backup) |
void | fill_abuffer_from (lives_audio_buf_t *abuf, weed_plant_t *event_list, weed_plant_t *st_event, boolean exact) |
void | wake_audio_thread (void) |
boolean | resync_audio (double frameno) |
resync audio playback to the current video frame More... | |
void | avsync_force (void) |
lives_audio_track_state_t * | get_audio_and_effects_state_at (weed_plant_t *event_list, weed_plant_t *st_event, weed_timecode_t fill_tc, int what_to_get, boolean exact) |
get audio (and optionally video) state at timecode tc OR before event st_event More... | |
boolean | get_audio_from_plugin (float **fbuffer, int nchans, int arate, int nsamps, boolean is_audio_thread) |
void | reinit_audio_gen (void) |
void | init_jack_audio_buffers (int achans, int arate, boolean exact) |
void | free_jack_audio_buffers (void) |
void | init_pulse_audio_buffers (int achans, int arate, boolean exact) |
void | free_pulse_audio_buffers (void) |
void | audio_free_fnames (void) |
void | preview_aud_vol (void) |
lives_audio_buf_t * | audio_cache_init (void) |
void | audio_cache_end (void) |
lives_audio_buf_t * | audio_cache_get_buffer (void) |
boolean | apply_rte_audio_init (void) |
void | apply_rte_audio_end (boolean del) |
boolean | apply_rte_audio (int64_t nframes) |
void | init_audio_frame_buffers (short aplayer) |
void | free_audio_frame_buffer (lives_audio_buf_t *abuf) |
void | append_to_audio_bufferf (float *src, uint64_t nsamples, int channum) |
void | append_to_audio_buffer16 (void *src, uint64_t nsamples, int channum) |
boolean | push_audio_to_channel (weed_plant_t *filter, weed_plant_t *achan, lives_audio_buf_t *abuf) |
fill the audio channel(s) for effects with mixed audio / video More... | |
boolean | start_audio_stream (void) |
void | stop_audio_stream (void) |
void | clear_audio_stream (void) |
void | audio_stream (void *buff, size_t nbytes, int fd) |
char * | lives_get_audio_file_name (int fnum) |
char * | get_audio_file_name (int fnum, boolean opening) |
char * | get_achannel_name (int totchans, int idx) WARN_UNUSED |
const char * | audio_player_get_display_name (const char *aplayer) |
lives_cancel_t | handle_audio_timeout (void) |
lives_audio_track_state_t * | audio_frame_to_atstate (weed_plant_t *event, int *ntracks) |
#define AUD_WRITE_CHECK 0xFFFFFFFFF4000000 |
#define DEFAULT_AUDIO_RATE 44100 |
#define DEFAULT_AUDIO_SIGNED16 (!AFORM_UNSIGNED) |
#define DEFAULT_AUDIO_SIGNED8 (AFORM_UNSIGNED) |
#define is_realtime_aplayer | ( | ptype | ) | ((ptype == AUD_PLAYER_JACK || ptype == AUD_PLAYER_PULSE || ptype == AUD_PLAYER_NONE)) |
#define MAX_AUDIO_MEM 32 * 1024 * 1024 |
#define RENDER_BLOCK_SIZE 1024 |
#define SILENCE_BLOCK_SIZE BUFFER_FILL_BYTES_LARGE |
#define XSAMPLES 393216 |
enum lives_audio_loop_t |
enum lives_operation_t |
void append_to_audio_buffer16 | ( | void * | src, |
uint64_t | nsamples, | ||
int | channum | ||
) |
void append_to_audio_bufferf | ( | float * | src, |
uint64_t | nsamples, | ||
int | channum | ||
) |
void aud_fade | ( | int | fileno, |
double | startt, | ||
double | endt, | ||
double | startv, | ||
double | endv | ||
) |
fade in/fade out
Definition at line 1813 of file audio.c.
Referenced by adjust_clip_volume(), and on_fade_audio_activate().
void audio_cache_end | ( | void | ) |
lives_audio_buf_t* audio_cache_get_buffer | ( | void | ) |
lives_audio_buf_t* audio_cache_init | ( | void | ) |
lives_audio_track_state_t* audio_frame_to_atstate | ( | weed_plant_t * | event, |
int * | ntracks | ||
) |
Definition at line 2405 of file audio.c.
Referenced by pre_analyse().
void audio_free_fnames | ( | void | ) |
Definition at line 71 of file audio.c.
Referenced by on_fade_audio_activate(), render_events(), and render_to_clip().
const char* audio_player_get_display_name | ( | const char * | aplayer | ) |
Definition at line 65 of file audio.c.
Referenced by handle_audio_timeout().
float audiofile_get_maxvol | ( | int | fnum, |
double | start, | ||
double | end, | ||
float | thresh | ||
) |
void avsync_force | ( | void | ) |
force realignment of video and audio at current file->frameno / player->seek_pos
Definition at line 2785 of file audio.c.
Referenced by switch_audio_clip().
void fill_abuffer_from | ( | lives_audio_buf_t * | abuf, |
weed_plant_t * | event_list, | ||
weed_plant_t * | st_event, | ||
boolean | exact | ||
) |
boolean float_deinterleave | ( | float * | fbuffer, |
int | nsamps, | ||
int | nchans | ||
) |
boolean float_interleave | ( | float * | fbuffer, |
int | nsamps, | ||
int | nchans | ||
) |
void free_audio_frame_buffer | ( | lives_audio_buf_t * | abuf | ) |
Definition at line 207 of file audio.c.
Referenced by append_to_audio_buffer16(), and append_to_audio_bufferf().
char* get_achannel_name | ( | int | totchans, |
int | idx | ||
) |
Definition at line 28 of file audio.c.
Referenced by add_audio_track(), and show_playbar_labels().
lives_audio_track_state_t* get_audio_and_effects_state_at | ( | weed_plant_t * | event_list, |
weed_plant_t * | st_event, | ||
weed_timecode_t | fill_tc, | ||
int | what_to_get, | ||
boolean | exact | ||
) |
get audio (and optionally video) state at timecode tc OR before event st_event
if st_event is not NULL, we get the state just prior to it (state being effects and filter maps, audio tracks / positions)
if st_event is NULL, this is a continuation, and we get the audio state only at timecode tc similar to quantise_events(), except we don't produce output frames
TODO: if exact && non-stateless, silently process audio / video until st_event
update audio state
Definition at line 2419 of file audio.c.
Referenced by audio_process_events_to(), and fill_abuffer_from().
char* get_audio_file_name | ( | int | fnum, |
boolean | opening | ||
) |
Definition at line 38 of file audio.c.
Referenced by lives_get_audio_file_name().
float get_float_audio_val_at_time | ( | int | fnum, |
int | afd, | ||
double | secs, | ||
int | chnum, | ||
int | chans | ||
) |
lives_cancel_t handle_audio_timeout | ( | void | ) |
Definition at line 3971 of file audio.c.
Referenced by _start_playback(), load_frame_image(), play_sel(), preview_audio(), and switch_audio_clip().
void init_jack_audio_buffers | ( | int | achans, |
int | arate, | ||
boolean | exact | ||
) |
void init_pulse_audio_buffers | ( | int | achans, |
int | arate, | ||
boolean | exact | ||
) |
char* lives_get_audio_file_name | ( | int | fnum | ) |
Definition at line 55 of file audio.c.
Referenced by aud_fade(), on_recaudclip_ok_clicked(), reget_afilesize_inner(), and wait_for_bg_audio_sync().
boolean normalise_audio | ( | int | fnum, |
double | start, | ||
double | end, | ||
float | thresh | ||
) |
Definition at line 280 of file audio.c.
Referenced by on_normalise_audio_activate().
boolean push_audio_to_channel | ( | weed_plant_t * | filter, |
weed_plant_t * | achan, | ||
lives_audio_buf_t * | abuf | ||
) |
fill the audio channel(s) for effects with mixed audio / video
push audio from abuf into an audio channel audio will be formatted to the channel requested format
when we have audio effects running, the buffer is constantly fiiled from the audio thread (we have two buffers so that we dont hang the player during read). When the first client reads, the buffers are swapped.
if player is jack, we will have non-interleaved float, if player is pulse, we will have interleaved S16 so we have to convert to float and then back again.
(this is currently only used to push audio to generators, since there are currently no filters which allow both video and audio input)
int64_t render_audio_segment | ( | int | nfiles, |
int * | from_files, | ||
int | to_file, | ||
double * | avels, | ||
double * | fromtime, | ||
ticks_t | tc_start, | ||
ticks_t | tc_end, | ||
double * | chvol, | ||
double | opvol_start, | ||
double | opvol_end, | ||
lives_audio_buf_t * | obuf | ||
) |
boolean resync_audio | ( | double | frameno | ) |
resync audio playback to the current video frame
if we are using a realtime audio player, resync to frameno and return TRUE
otherwise return FALSE
this is called internally - for example when the play position jumps, either due to external transport changes, (e.g. jack transport, osc retrigger / goto) or if we are looping a video selection, or it may be triggered from the keyboard
this is only active if "audio follows video rate/fps changes" is set and various other conditions are met.
Definition at line 2822 of file audio.c.
Referenced by aud_lock_callback(), fps_reset_callback(), and load_frame_image().
int64_t sample_move_abuf_float | ( | float ** | obuf, |
int | nchans, | ||
int | nsamps, | ||
int | out_arate, | ||
float | vol | ||
) |
int64_t sample_move_abuf_int16 | ( | short * | obuf, |
int | nchans, | ||
int | nsamps, | ||
int | out_arate | ||
) |
void sample_move_d16_d16 | ( | short * | dst, |
short * | src, | ||
uint64_t | nsamples, | ||
size_t | tbytes, | ||
double | scale, | ||
int | nDstChannels, | ||
int | nSrcChannels, | ||
int | swap_endian, | ||
int | swap_sign | ||
) |
void sample_move_d16_d8 | ( | uint8_t * | dst, |
short * | src, | ||
uint64_t | nsamples, | ||
size_t | tbytes, | ||
double | scale, | ||
int | nDstChannels, | ||
int | nSrcChannels, | ||
int | swap_sign | ||
) |
float sample_move_d16_float | ( | float * | dst, |
short * | src, | ||
uint64_t | nsamples, | ||
uint64_t | src_skip, | ||
int | is_unsigned, | ||
boolean | rev_endian, | ||
float | vol | ||
) |
Definition at line 677 of file audio.c.
Referenced by push_audio_to_channel().
void sample_move_d8_d16 | ( | short * | dst, |
uint8_t * | src, | ||
uint64_t | nsamples, | ||
size_t | tbytes, | ||
double | scale, | ||
int | nDstChannels, | ||
int | nSrcChannels, | ||
int | swap_sign | ||
) |
Definition at line 459 of file audio.c.
Referenced by push_audio_to_channel().
void sample_move_float_float | ( | float * | dst, |
float * | src, | ||
uint64_t | nsamples, | ||
double | scale, | ||
int | dst_skip | ||
) |
Definition at line 745 of file audio.c.
Referenced by push_audio_to_channel().
int64_t sample_move_float_int | ( | void * | holding_buff, |
float ** | float_buffer, | ||
int | nsamps, | ||
double | scale, | ||
int | chans, | ||
int | asamps, | ||
int | usigned, | ||
boolean | rev_endian, | ||
boolean | interleaved, | ||
float | vol | ||
) |
returns frames output
returns frames output
clipping is applied so that -1.0 <= fval <= 1.0 the clipping value is applied linearly to vol (as a divisor), and if not reset it will decay so clip = 1.0 + (clip - 1.0) * CLIP_DECAY each sample --> clip = 1.0 + clip * CLIP_DECAY - CLIP_DECAY --> clip = (clip * CLIP_DECAY) + (1.0 - CLIP_DECAY) --> clip *= CLIP_DECAY; clip += (1.0 - CLIP_DECAY)
boolean start_audio_stream | ( | void | ) |
Definition at line 3827 of file audio.c.
Referenced by on_vppa_ok_clicked().
void stop_audio_stream | ( | void | ) |
Definition at line 3906 of file audio.c.
Referenced by close_vid_playback_plugin(), lives_exit(), on_vppa_ok_clicked(), and vid_playback_plugin_exit().
void wake_audio_thread | ( | void | ) |
Definition at line 3230 of file audio.c.
Referenced by sample_move_abuf_float(), and sample_move_abuf_int16().