71 #ifndef LIBTELETONE_GENERATE_H
72 #define LIBTELETONE_GENERATE_H
83 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
85 #define __inline__ inline
91 #define __inline__ __inline
94 #if !defined(_STDINT) && !defined(uint32_t)
95 typedef unsigned __int64 uint64_t;
96 typedef unsigned __int32 uint32_t;
97 typedef unsigned __int16 uint16_t;
98 typedef unsigned __int8 uint8_t;
99 typedef __int64 int64_t;
100 typedef __int32 int32_t;
101 typedef __int16 int16_t;
102 typedef __int8 int8_t;
107 #include <sys/types.h>
108 #include <sys/stat.h>
111 #if !defined(powf) && !defined(_WIN64)
113 #pragma warning(push)
114 #pragma warning(disable: 28251)
116 extern float powf (
float,
float);
130 #define TELETONE_VOL_DB_MAX 0
131 #define TELETONE_VOL_DB_MIN -63
132 #define MAX_PHASE_TONES 4
142 #define SINE_TABLE_MAX 128
143 #define SINE_TABLE_LEN (SINE_TABLE_MAX - 1)
144 #define MAX_PHASE_ACCUMULATOR 0x10000 * 0x10000
147 #define DBM0_MAX_POWER (3.14f + 3.02f)
171 if (bitmask & (SINE_TABLE_MAX * 2)) {
#define TELETONE_API_DATA
static __inline__ int16_t teletone_dds_state_modulate_sample(teletone_dds_state_t *dds, uint32_t pindex)
An abstraction to store a tone mapping.
teletone_audio_t * buffer
uint32_t phase_rate[MAX_PHASE_TONES]
double teletone_process_t
static __inline__ int teletone_dds_state_set_tone(teletone_dds_state_t *dds, teletone_process_t tone, uint32_t rate, uint32_t pindex)
#define TELETONE_API(type)
int teletone_mux_tones(teletone_generation_session_t *ts, teletone_tone_map_t *map)
Execute a single tone generation instruction.
int teletone_destroy_session(teletone_generation_session_t *ts)
Free the buffer allocated by a tone generation session.
int teletone_set_map(teletone_tone_map_t *map,...)
Assign a set of tones to a single tone map.
teletone_tone_map_t TONES[TELETONE_TONE_RANGE]
teletone_process_t tx_level
#define MAX_PHASE_ACCUMULATOR
static __inline__ void teletone_dds_state_set_tx_level(teletone_dds_state_t *dds, float tx_level)
int teletone_init_session(teletone_generation_session_t *ts, int buflen, tone_handler handler, void *user_data)
Initilize a tone generation session.
uint32_t phase_accumulator
int teletone_run(teletone_generation_session_t *ts, const char *cmd)
Execute a tone generation script and call callbacks after each instruction.
switch_byte_t switch_byte_t uint32_t buflen
static __inline__ int32_t teletone_dds_phase_rate(teletone_process_t tone, uint32_t rate)
#define TELETONE_TONE_RANGE
static __inline__ void teletone_dds_state_reset_accum(teletone_dds_state_t *dds)
An abstraction to store a tone generation session.
int(* tone_handler)(struct teletone_generation_session *ts, teletone_tone_map_t *map)
int16_t TELETONE_SINES[SINE_TABLE_MAX]
int teletone_set_tone(teletone_generation_session_t *ts, int index,...)
Assign a set of tones to a tone_session indexed by a paticular index/character.