Пример #1
0
        public void InitDecoder(bool useJitterBuffer, int stepSize, int frameSize)
        {
            this.frameSize = frameSize;
            decodedBits    = new SpeexBits();
            decoderState   = speex_decoder_init_new(0);
            fixed(SpeexBits *bitsDecode = &decodedBits)
            {
                speex_bits_init(bitsDecode);
            }

            if (useJitterBuffer)
            {
                jitterBuffer    = jitter_buffer_init(stepSize);
                validJitterBits = false;
            }
        }
Пример #2
0
        public int InitEncoder(int maxFrameSize, int samplesPerFrame, int samplingRate)
        {
            this.maxFrameSize = maxFrameSize;
            encodedBits       = new SpeexBits();
            encoderState      = speex_encoder_init_new(0);
            // Don't set VAD in the codec, because we're setting it in
            // the preprocessor instead
            fixed(int *fSize = &frameSize)
            {
                speex_encoder_ctl(encoderState, (int)SpeexCtlCode.SPEEX_GET_FRAME_SIZE, fSize);
            }

            fixed(SpeexBits *bitsAdd = &encodedBits)
            {
                speex_bits_init(bitsAdd);
            }

            preprocessState = speex_preprocess_state_init(samplesPerFrame, samplingRate);
            return(frameSize);
        }
Пример #3
0
 public static extern int speex_bits_remaining(ref SpeexBits bits);
Пример #4
0
 public static extern void speex_bits_destroy(ref SpeexBits bits);
Пример #5
0
 public static extern uint speex_bits_peek(ref SpeexBits bits);
Пример #6
0
 public static extern void speex_bits_insert_terminator(ref SpeexBits bits);
Пример #7
0
 public extern static int Speex_bits_unpack_signed(ref SpeexBits bits, int nbBits);
Пример #8
0
/** Frees all resources associated to a SpeexBits struct. Right now this does nothing since no resources are allocated, but this could change in the future.*/
void speex_bits_destroy(SpeexBits *bits);
Пример #9
0
/** Append bytes to the bit-stream
 * 
 * @param bits Bit-stream to operate on
 * @param bytes pointer to the bytes what will be appended
 * @param len Number of bytes of append
 */
void speex_bits_read_whole_bytes(SpeexBits *bits, char *bytes, int len);
Пример #10
0
 public static extern int speex_bits_remaining(ref SpeexBits bits);
Пример #11
0
 public static extern void speex_bits_rewind(ref SpeexBits bits);
Пример #12
0
 public static extern void speex_bits_read_from(ref SpeexBits bits, byte[] bytes, int len);
Пример #13
0
 public static extern void speex_bits_read_whole_bytes(ref SpeexBits bits, IntPtr bytes, int len);
Пример #14
0
 public static extern int speex_bits_peek(ref SpeexBits bits);
Пример #15
0
 public static extern void speex_bits_pack(ref SpeexBits bits, int data, int nbBits);
Пример #16
0
 public static extern int speex_bits_nbytes(ref SpeexBits bits);
Пример #17
0
 public static extern void speex_bits_insert_terminator(ref SpeexBits bits);
Пример #18
0
 public static extern void speex_bits_set_bit_buffer(ref SpeexBits bits, IntPtr buff, int buf_size);
Пример #19
0
   IntPtr reserved2; /**< Reserved for future use */

/** Initializes and allocates resources for a SpeexBits struct */
void speex_bits_init(SpeexBits bits);
Пример #20
0
/** Uses an existing decoder state to decode one frame of speech from
 * bit-stream bits. The output speech is saved written to out.
 *
 * @param state Decoder state
 * @param bits Bit-stream from which to decode the frame (NULL if the packet was lost)
 * @param out Where to write the decoded frame
 * @return return status (0 for no error, -1 for end of stream, -2 corrupt stream)
 */
int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out);
Пример #21
0
/** Rewind the bit-stream to the beginning (ready for read) without erasing the content */
void speex_bits_rewind(SpeexBits *bits);
Пример #22
0
 public extern static IntPtr Speex_bits_init_buffer(ref SpeexBits bits, byte[] ouput, int len);
Пример #23
0
 public static extern uint speex_bits_unpack_unsigned(ref SpeexBits bits, int nbBits);
Пример #24
0
 public static extern void speex_bits_init(ref SpeexBits bits);
Пример #25
0
 public extern static void Speex_bits_reset(ref SpeexBits bits);
Пример #26
0
 public static extern int speex_bits_write(ref SpeexBits bits, byte[] bytes, int max_len);
Пример #27
0
 public extern static void Speex_bits_set_bit_buffer(ref SpeexBits bits, byte[] buff, int buffSize);
Пример #28
0
 public static extern int speex_bits_write_whole_bytes(ref SpeexBits bits, IntPtr bytes, int max_len);
Пример #29
0
 public extern static void Speex_bits_read_from(ref SpeexBits bits, byte[] bytes, int len);
Пример #30
0
 public static extern int speex_decode(IntPtr state, ref SpeexBits bits, IntPtr outFloat);
Пример #31
0
 public static extern uint speex_bits_peek_unsigned(ref SpeexBits bits, int nbBits);
Пример #32
0
 public static extern int speex_decode_int(IntPtr state, ref SpeexBits bits, byte[] outShort);
Пример #33
0
 public static extern void speex_bits_advance(ref SpeexBits bits, int n);
Пример #34
0
 public static extern int speex_encode(IntPtr state, IntPtr inFloat, ref SpeexBits bits);
Пример #35
0
 public static extern void speex_bits_init(ref SpeexBits bits);
Пример #36
0
 public static extern int speex_encode_int(IntPtr state, IntPtr inShort, ref SpeexBits bits);
Пример #37
0
 public static extern void speex_bits_init_buffer(ref SpeexBits bits, byte[] buff, int buf_size);
Пример #38
0
 public static extern void speex_encode_stereo(float[] data, int frame_size, ref SpeexBits bits);
Пример #39
0
/** Sets the bits in a SpeexBits struct to use data from an existing buffer (for decoding without copying data) */
void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size);
Пример #40
0
 public static extern void speex_encode_stereo_int(Int16[] data, int frame_size, ref SpeexBits bits);
Пример #41
0
/** Resets bits to initial value (just after initialization, erasing content)*/
void speex_bits_reset(SpeexBits *bits);
Пример #42
0
 public static extern int speex_std_stereo_request_handler(ref SpeexBits bits, IntPtr state, IntPtr data);
Пример #43
0
/** Initializes the bit-stream from the data in an area of memory */
void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
Пример #44
0
/** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */
void speex_encode_stereo(float *data, int frame_size, SpeexBits *bits);
Пример #45
0
/** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */
void speex_encode_stereo_int(spx_int16_t *data, int frame_size, SpeexBits *bits);
Пример #46
0
/** Callback handler for intensity stereo info */
int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data);
Пример #47
0
/** Uses an existing decoder state to decode one frame of speech from
 * bit-stream bits. The output speech is saved written to out.
 *
 * @param state Decoder state
 * @param bits Bit-stream from which to decode the frame (NULL if the packet was lost)
 * @param out Where to write the decoded frame
 * @return return status (0 for no error, -1 for end of stream, -2 corrupt stream)
 */
int speex_decode(void *state, SpeexBits *bits, float *out);
Пример #48
0
 public static extern void speex_bits_destroy(ref SpeexBits bits);
Пример #49
0
 public extern static void Speex_bits_init(ref SpeexBits bits);
Пример #50
0
 public static extern void speex_bits_rewind(ref SpeexBits bits);
Пример #51
0
 public extern static int Speex_bits_write(ref SpeexBits bits, byte[] ouput, int len);
Пример #52
0
 public static extern void speex_bits_read_whole_bytes(ref SpeexBits bits, byte[] bytes, int len);
Пример #53
0
 public extern static int Speex_bits_peek(ref SpeexBits bits);
Пример #54
0
 public static extern int speex_bits_write_whole_bytes(ref SpeexBits bits, byte[] bytes, int max_len);
Пример #55
0
 public extern static int Speex_bits_rewind(ref SpeexBits bits);
Пример #56
0
 public static extern void speex_bits_pack(ref SpeexBits bits, int data, int nbBits);
Пример #57
0
 public extern static void Speex_bits_destroy(ref SpeexBits bits);
Пример #58
0
 public static extern int speex_bits_nbytes(ref SpeexBits bits);
Пример #59
0
 public extern static int Speex_bits_nbytes(ref SpeexBits bits);
Пример #60
0
 public extern static int Speex_decode_int(IntPtr state, ref SpeexBits bits, short[] output);