telephony.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #if !defined(_SPANDSP_TELEPHONY_H_)
00029 #define _SPANDSP_TELEPHONY_H_
00030
00031 #if defined(_M_IX86) || defined(_M_X64)
00032 #if defined(LIBSPANDSP_EXPORTS)
00033 #define SPAN_DECLARE(type) __declspec(dllexport) type __stdcall
00034 #define SPAN_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
00035 #define SPAN_DECLARE_DATA __declspec(dllexport)
00036 #else
00037 #define SPAN_DECLARE(type) __declspec(dllimport) type __stdcall
00038 #define SPAN_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
00039 #define SPAN_DECLARE_DATA __declspec(dllimport)
00040 #endif
00041 #elif defined(SPANDSP_USE_EXPORT_CAPABILITY) && (defined(__GNUC__) || defined(__SUNCC__))
00042 #define SPAN_DECLARE(type) __attribute__((visibility("default"))) type
00043 #define SPAN_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type
00044 #define SPAN_DECLARE_DATA __attribute__((visibility("default")))
00045 #else
00046 #define SPAN_DECLARE(type) type
00047 #define SPAN_DECLARE_NONSTD(type) type
00048 #define SPAN_DECLARE_DATA
00049 #endif
00050
00051 #define SAMPLE_RATE 8000
00052
00053
00054 #define DBM0_MAX_POWER (3.14f + 3.02f)
00055 #define DBM0_MAX_SINE_POWER (3.14f)
00056
00057 #define DBOV_MAX_POWER (0.0f)
00058 #define DBOV_MAX_SINE_POWER (-3.02f)
00059
00060
00061 typedef int (span_rx_handler_t)(void *s, const int16_t amp[], int len);
00062
00063
00064 typedef int (span_mod_handler_t)(void *s, int16_t amp[], int len);
00065
00066
00067 typedef int (span_rx_fillin_handler_t)(void *s, int len);
00068
00069
00070 typedef int (span_tx_handler_t)(void *s, int16_t amp[], int max_len);
00071
00072 #define ms_to_samples(t) (((t)*SAMPLE_RATE)/1000)
00073 #define us_to_samples(t) (((t)*SAMPLE_RATE)/1000000)
00074
00075 #if !defined(FALSE)
00076 #define FALSE 0
00077 #endif
00078 #if !defined(TRUE)
00079 #define TRUE (!FALSE)
00080 #endif
00081
00082 #if defined(__cplusplus)
00083
00084 #if !defined(WIN32)
00085 #define lrint(x) ((long int) (x))
00086 #define lrintf(x) ((long int) (x))
00087 #endif
00088 #endif
00089
00090 #endif
00091