コード例 #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
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern void speex_bits_destroy(ref SpeexBits bits);
コード例 #5
0
 public static extern uint speex_bits_peek(ref SpeexBits bits);
コード例 #6
0
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 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
ファイル: speex_bits.cs プロジェクト: Wiladams/NewTOAPIA
/** 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
ファイル: speex_bits.cs プロジェクト: Wiladams/NewTOAPIA
/** 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
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern int speex_bits_remaining(ref SpeexBits bits);
コード例 #11
0
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern void speex_bits_rewind(ref SpeexBits bits);
コード例 #12
0
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern void speex_bits_read_from(ref SpeexBits bits, byte[] bytes, int len);
コード例 #13
0
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern void speex_bits_read_whole_bytes(ref SpeexBits bits, IntPtr bytes, int len);
コード例 #14
0
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern int speex_bits_peek(ref SpeexBits bits);
コード例 #15
0
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern void speex_bits_pack(ref SpeexBits bits, int data, int nbBits);
コード例 #16
0
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 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
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern void speex_bits_set_bit_buffer(ref SpeexBits bits, IntPtr buff, int buf_size);
コード例 #19
0
ファイル: speex_bits.cs プロジェクト: Wiladams/NewTOAPIA
   IntPtr reserved2; /**< Reserved for future use */

/** Initializes and allocates resources for a SpeexBits struct */
void speex_bits_init(SpeexBits bits);
コード例 #20
0
ファイル: speex.cs プロジェクト: Wiladams/NewTOAPIA
/** 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
ファイル: speex_bits.cs プロジェクト: Wiladams/NewTOAPIA
/** 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
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern uint speex_bits_unpack_unsigned(ref SpeexBits bits, int nbBits);
コード例 #24
0
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 public static extern void speex_bits_init(ref SpeexBits bits);
コード例 #25
0
 public extern static void Speex_bits_reset(ref SpeexBits bits);
コード例 #26
0
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 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
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 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
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 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
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 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
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 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
ファイル: Speex.cs プロジェクト: RoelofSol/DeOps
 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
ファイル: speex_bits.cs プロジェクト: Wiladams/NewTOAPIA
/** 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
ファイル: speex_bits.cs プロジェクト: Wiladams/NewTOAPIA
/** 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
ファイル: speex_bits.cs プロジェクト: Wiladams/NewTOAPIA
/** 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
ファイル: speex_stereo.cs プロジェクト: Wiladams/NewTOAPIA
/** 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
ファイル: speex_stereo.cs プロジェクト: Wiladams/NewTOAPIA
/** 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
ファイル: speex_stereo.cs プロジェクト: Wiladams/NewTOAPIA
/** Callback handler for intensity stereo info */
int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data);
コード例 #47
0
ファイル: speex.cs プロジェクト: Wiladams/NewTOAPIA
/** 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);