-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp_opus.h
More file actions
executable file
·65 lines (46 loc) · 1.35 KB
/
php_opus.h
File metadata and controls
executable file
·65 lines (46 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef PHP_OPUS_H
#define PHP_OPUS_H
#include "php.h"
#include <opus/opus.h>
#ifdef HAVE_LIBSOXR
#include "soxr.h"
#endif
extern zend_module_entry opus_module_entry;
#define phpext_opus_ptr &opus_module_entry
#define PHP_OPUS_VERSION "1.1.1"
typedef struct _opus_channel_t {
OpusEncoder *encoder;
OpusDecoder *decoder;
int sample_rate;
int channels;
#ifdef HAVE_LIBSOXR
soxr_t soxr_state;
double soxr_src_rate;
double soxr_dst_rate;
#endif
// State for enhanceVoiceClarity (per-instance instead of static)
float hp_prev;
float lp_prev;
// State for spatialStereoEnhance (per-instance instead of static)
opus_int16 delay_buffer[4096];
size_t delay_pos;
float ap_state_l;
float ap_state_r;
float reverb_l;
float reverb_r;
} opus_channel_t;
PHP_METHOD(opusChannel, __construct);
PHP_METHOD(opusChannel, encode);
PHP_METHOD(opusChannel, decode);
PHP_METHOD(opusChannel, resample);
PHP_METHOD(opusChannel, destroy);
PHP_METHOD(opusChannel, enhanceVoiceClarity);
PHP_METHOD(opusChannel, spatialStereoEnhance);
PHP_METHOD(opusChannel, monoToStereo);
PHP_METHOD(opusChannel, stereoToMono);
PHP_METHOD(opusChannel, hasLibsoxr);
PHP_METHOD(opusChannel, getInfo);
ZEND_FUNCTION(resample);
void register_opus_channel_class(void);
void opus_channel_free_storage(zend_object *object);
#endif /* PHP_OPUS_H */