7 #ifndef HAS_LIVES_AUDIO_H 8 #define HAS_LIVES_AUDIO_H 10 #define SAMPLE_MAX_16BIT_P 32767.0f 11 #define SAMPLE_MAX_16BIT_N 32768.0f 12 #define SAMPLE_MAX_16BITI 32768 24 # define DEFAULT_AUDIO_RATE 44100 25 # define DEFAULT_AUDIO_CHANS 2 26 # define DEFAULT_AUDIO_SAMPS 16 27 # define DEFAULT_AUDIO_SIGNED8 (AFORM_UNSIGNED) 28 # define DEFAULT_AUDIO_SIGNED16 (!AFORM_UNSIGNED) 34 #define MAX_AUDIO_MEM 8*1024*1024 37 #define RENDER_BLOCK_SIZE 1024 40 #define SILENCE_BLOCK_SIZE 65536 43 #define READ_BLOCK_SIZE 4096 46 #define XSAMPLES 128000 48 #define AUD_WRITTEN_CHECK 100000000 54 #define ASERVER_CMD_PROCESSED 0 55 #define ASERVER_CMD_FILE_OPEN 1 56 #define ASERVER_CMD_FILE_CLOSE 2 57 #define ASERVER_CMD_FILE_SEEK 3 60 typedef struct _aserver_message_t {
63 volatile struct _aserver_message_t *
next;
140 typedef enum lives_audio_loop {
153 uint64_t nsamples,
size_t tbytes,
float scale,
int nDstChannels,
int nSrcChannels,
int swap_sign);
156 uint64_t nsamples,
size_t tbytes,
float scale,
int nDstChannels,
int nSrcChannels,
int swap_endian,
int swap_sign);
159 uint64_t nsamples,
size_t tbytes,
float scale,
int nDstChannels,
int nSrcChannels,
int swap_sign);
161 float sample_move_d16_float(
float *dst,
short *src, uint64_t nsamples, uint64_t src_skip,
int is_unsigned,
boolean rev_endian,
float vol);
163 int64_t
sample_move_float_int(
void *holding_buff,
float **float_buffer,
int nsamps,
float scale,
int chans,
int asamps,
int usigned,
164 boolean swap_endian,
boolean float_interleaved,
float vol);
175 int64_t
render_audio_segment(
int nfiles,
int *from_files,
int to_file,
double *avels,
double *fromtime, weed_timecode_t tc_start,
176 weed_timecode_t tc_end,
double *chvol,
double opvol_start,
double opvol_end,
lives_audio_buf_t *obuf);
178 void aud_fade(
int fileno,
double startt,
double endt,
double startv,
double endv);
190 void jack_rec_audio_end(
boolean close_dev,
boolean close_fd);
193 #ifdef HAVE_PULSE_AUDIO 195 void pulse_rec_audio_end(
boolean close_dev,
boolean close_fd);
int32_t ** buffer32
sample data in 32 bit format (or NULL)
Definition: audio.h:111
lives_audio_loop_t
Definition: audio.h:140
int _fd
file descriptor
Definition: audio.h:127
void fill_abuffer_from(lives_audio_buf_t *abuf, weed_plant_t *event_list, weed_plant_t *st_event, boolean exact)
Definition: audio.c:1912
float ** bufferf
sample data in float format (or NULL)
Definition: audio.h:112
int _cin_interleaf
Definition: audio.h:131
int out_achans
channels for buffer* side
Definition: audio.h:93
void sample_move_float_float(float *dst, float *src, uint64_t nsamples, float scale, int dst_skip)
Definition: audio.c:528
size_t _csamp_space
current sample buffer size in single channel samples
Definition: audio.h:126
int swap_sign
Definition: audio.h:96
boolean eof
did we read EOF ? [readonly by client]
Definition: audio.h:76
short ** buffer16
sample data in 16 bit format (or NULL)
Definition: audio.h:107
int _cseek
current seek pos
Definition: audio.h:129
void sample_move_d16_d8(uint8_t *dst, short *src, uint64_t nsamples, size_t tbytes, float scale, int nDstChannels, int nSrcChannels, int swap_sign)
Definition: audio.c:409
int64_t render_audio_segment(int nfiles, int *from_files, int to_file, double *avels, double *fromtime, weed_timecode_t tc_start, weed_timecode_t tc_end, double *chvol, double opvol_start, double opvol_end, lives_audio_buf_t *obuf)
Definition: audio.c:969
boolean push_audio_to_channel(weed_plant_t *achan, lives_audio_buf_t *abuf)
Definition: audio.c:2936
ssize_t bytesize
Definition: audio.h:87
boolean float_deinterleave(float *fbuffer, int nsamps, int nchans)
Definition: audio.c:821
lives_audio_track_state_t * get_audio_and_effects_state_at(weed_plant_t *event_list, weed_plant_t *st_event, boolean get_audstate, boolean exact)
Definition: audio.c:1828
volatile struct _aserver_message_t * next
Definition: audio.h:63
double arate
Definition: audio.h:85
boolean in_interleaf
Definition: audio.h:89
lives_operation_t
Definition: audio.h:66
void audio_stream(void *buff, size_t nbytes, int fd)
Definition: audio.c:3206
void init_audio_frame_buffer(short aplayer)
Definition: audio.c:124
lives_audio_buf_t * audio_cache_get_buffer(void)
Definition: audio.c:2582
boolean resync_audio(int frameno)
Definition: audio.c:2167
void append_to_audio_bufferf(lives_audio_buf_t *abuf, float *src, uint64_t nsamples, int channum)
Definition: audio.c:70
boolean s8_signed
Definition: audio.h:114
void sample_move_d16_d16(short *dst, short *src, uint64_t nsamples, size_t tbytes, float scale, int nDstChannels, int nSrcChannels, int swap_endian, int swap_sign)
boolean get_audio_from_plugin(float *fbuffer, int nchans, int arate, int nsamps)
Definition: audio.c:2591
volatile char * data
Definition: audio.h:62
int64_t sample_move_float_int(void *holding_buff, float **float_buffer, int nsamps, float scale, int chans, int asamps, int usigned, boolean swap_endian, boolean float_interleaved, float vol)
returns frames output
Definition: audio.c:542
boolean start_audio_stream(void)
Definition: audio.c:3070
void apply_rte_audio_end(boolean del)
Definition: audio.c:2762
void sample_silence_stream(int nchans, int nframes)
Definition: audio.c:257
boolean s16_signed
Definition: audio.h:115
void reinit_audio_gen(void)
Definition: audio.c:2704
boolean out_interleaf
Definition: audio.h:90
volatile boolean die
set to TRUE to shut down thread
Definition: audio.h:135
int in_asamps
Definition: audio.h:94
boolean sequential
hint that we will read sequentially starting from seek
Definition: audio.h:102
ssize_t _cbytesize
current _filebuffer bytesize; if this changes we need to realloc _filebuffer
Definition: audio.h:125
void audio_cache_end(void)
Definition: audio.c:2550
int _cfileno
current fileno
Definition: audio.h:128
boolean s24_signed
Definition: audio.h:116
uint8_t ** buffer16_8
sample data in 8 bit format (or NULL)
Definition: audio.h:108
volatile int command
Definition: audio.h:61
void clear_audio_stream(void)
Definition: audio.c:3191
void append_to_audio_buffer16(lives_audio_buf_t *abuf, void *src, uint64_t nsamples, int channum)
Definition: audio.c:95
int64_t sample_move_abuf_float(float **obuf, int nchans, int nsamps, int out_arate, float vol)
Definition: audio.c:602
size_t start_sample
used for reading (readonly server)
Definition: audio.h:121
double shrink_factor
resampling ratio
Definition: audio.h:98
int64_t sample_move_abuf_int16(short *obuf, int nchans, int nsamps, int out_arate)
Definition: audio.c:704
int swap_endian
Definition: audio.h:97
void init_pulse_audio_buffers(int achans, int arate, boolean exact)
Definition: audio.c:2103
char * lives_get_audio_file_name(int fnum)
Definition: audio.c:43
int out_asamps
Definition: audio.h:95
boolean float_interleave(float *fbuffer, int nsamps, int nchans)
Definition: audio.c:839
size_t samp_space
buffer space in samples (* by sizeof(type) to get bytesize) [if interleaf, also * by chans] ...
Definition: audio.h:100
int _casamps
current out_asamps
Definition: audio.h:133
uint8_t * _filebuffer
raw data to/from file - can be cast to int16_t
Definition: audio.h:124
void aud_fade(int fileno, double startt, double endt, double startv, double endv)
fade in/fade out
Definition: audio.c:1436
size_t samples_filled
number of samples filled (readonly client)
Definition: audio.h:120
void audio_free_fnames(void)
Definition: audio.c:54
boolean apply_rte_audio(int nframes)
Definition: audio.c:2769
float get_float_audio_val_at_time(int fnum, int afd, double secs, int chnum, int chans)
Definition: audio.c:198
void free_jack_audio_buffers(void)
Definition: audio.c:2123
int in_achans
channels for _filebuffer side
Definition: audio.h:92
lives_rec_audio_type_t
Definition: audio.h:180
void free_audio_frame_buffer(lives_audio_buf_t *abuf)
Definition: audio.c:158
int _cachans
current output channels
Definition: audio.h:130
boolean s32_signed
Definition: audio.h:117
void sample_silence_dS(float *dst, uint64_t nsamples)
Definition: audio.c:251
uint8_t ** buffer8
sample data in 8 bit format (or NULL)
Definition: audio.h:105
boolean apply_rte_audio_init(void)
Definition: audio.c:2728
int _cout_interleaf
Definition: audio.h:132
lives_audio_buf_t * audio_cache_init(void)
Definition: audio.c:2516
lives_operation_t operation
Definition: audio.h:74
int fileno
Definition: audio.h:77
int32_t ** buffer24
sample data in 24 bit format (or NULL)
Definition: audio.h:110
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: audio.c:461
volatile boolean is_ready
Definition: audio.h:75
weed_timecode_t start_tc
Definition: audio.h:83
void sample_move_d8_d16(short *dst, uint8_t *src, uint64_t nsamples, size_t tbytes, float scale, int nDstChannels, int nSrcChannels, int swap_sign)
Definition: audio.c:280
void init_jack_audio_buffers(int achans, int arate, boolean exact)
Definition: audio.c:2081
off_t seek
Definition: audio.h:82
void stop_audio_stream(void)
Definition: audio.c:3147
void free_pulse_audio_buffers(void)
Definition: audio.c:2146