资源简介
实现base64格式的amr音频文件在android微信内置浏览器的播放
代码片段和文件信息
/* ------------------------------------------------------------------
* Copyright (C) 2009 Martin Storsjo
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either
* express or implied.
* See the License for the specific language governing permissions
* and limitations under the License.
* -------------------------------------------------------------------
*/
#define AMRNB_WRAPPER_INTERNAL
#include
#include
#include
#include “interf_dec.h“
#include “interf_enc.h“
#include
#ifndef DISABLE_AMRNB_DECODER
void* Decoder_Interface_init(void) {
void* ptr = NULL;
GSMInitDecode(&ptr (int8*)“Decoder“);
return ptr;
}
void Decoder_Interface_exit(void* state) {
GSMDecodeframeExit(&state);
}
void Decoder_Interface_Decode(void* state const unsigned char* in short* out int bfi) {
unsigned char type = (in[0] >> 3) & 0x0f;
in++;
if (bfi) {
type = AMR_NO_DATA;
}
AMRDecode(state (enum frame_Type_3GPP) type (UWord8*) in out MIME_IETF);
}
#endif
#ifndef DISABLE_AMRNB_ENCODER
struct encoder_state {
void* encCtx;
void* pidSyncCtx;
};
void* Encoder_Interface_init(int dtx) {
struct encoder_state* state = (struct encoder_state*) malloc(sizeof(struct encoder_state));
AMREncodeInit(&state->encCtx &state->pidSyncCtx dtx);
return state;
}
void Encoder_Interface_exit(void* s) {
struct encoder_state* state = (struct encoder_state*) s;
AMREncodeExit(&state->encCtx &state->pidSyncCtx);
free(state);
}
int Encoder_Interface_Encode(void* s enum Mode mode const short* speech unsigned char* out int forceSpeech) {
struct encoder_state* state = (struct encoder_state*) s;
enum frame_Type_3GPP frame_type = (enum frame_Type_3GPP) mode;
int ret = AMREncode(state->encCtx state->pidSyncCtx mode (Word16*) speech out &frame_type AMR_TX_IETF);
out[0] |= 0x04;
return ret;
}
#endif
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 264 2015-09-09 12:45 opencore-amr-js-master\.gitignore
文件 296 2017-03-08 15:00 opencore-amr-js-master\.idea\modules.xm
文件 458 2017-03-08 15:00 opencore-amr-js-master\.idea\opencore-amr-js-master.iml
文件 16319 2017-03-09 19:45 opencore-amr-js-master\.idea\workspace.xm
文件 20 2015-09-09 12:45 opencore-amr-js-master\amrnb\.gitignore
文件 1063 2015-09-09 12:45 opencore-amr-js-master\amrnb\interf_dec.h
文件 1456 2015-09-09 12:45 opencore-amr-js-master\amrnb\interf_enc.h
文件 8047 2015-09-09 12:45 opencore-amr-js-master\amrnb\Makefile.am
文件 245 2015-09-09 12:45 opencore-amr-js-master\amrnb\opencore-amrnb.pc.in
文件 142 2015-09-09 12:45 opencore-amr-js-master\amrnb\opencore-amrnb.sym
文件 2246 2015-09-09 12:45 opencore-amr-js-master\amrnb\wrapper.cpp
文件 20 2015-09-09 12:45 opencore-amr-js-master\amrwb\.gitignore
文件 1043 2015-09-09 12:45 opencore-amr-js-master\amrwb\dec_if.h
文件 931 2015-09-09 12:45 opencore-amr-js-master\amrwb\if_rom.h
文件 3066 2015-09-09 12:45 opencore-amr-js-master\amrwb\Makefile.am
文件 254 2015-09-09 12:45 opencore-amr-js-master\amrwb\opencore-amrwb.pc.in
文件 32 2015-09-09 12:45 opencore-amr-js-master\amrwb\opencore-amrwb.sym
文件 3750 2015-09-09 12:45 opencore-amr-js-master\amrwb\wrapper.cpp
文件 784 2015-09-09 12:45 opencore-amr-js-master\ChangeLog
文件 2785 2015-09-09 12:45 opencore-amr-js-master\configure.ac
文件 484604 2015-09-09 12:45 opencore-amr-js-master\js\amrnb.js
文件 468 2015-09-09 12:45 opencore-amr-js-master\js\bld.sh
文件 31655 2017-03-09 18:55 opencore-amr-js-master\js\demo.html
文件 89878 2015-09-09 12:45 opencore-amr-js-master\js\hello.ogg
文件 539 2015-09-09 12:45 opencore-amr-js-master\js\Makefile
文件 9588 2015-09-09 12:45 opencore-amr-js-master\js\pre.js
文件 56934 2015-09-09 12:45 opencore-amr-js-master\js\yuan.amr
文件 569324 2015-09-09 12:45 opencore-amr-js-master\js\yuan.wav
文件 10271 2015-09-09 12:45 opencore-amr-js-master\LICENSE
文件 0 2015-09-09 12:45 opencore-amr-js-master\m4\.gitkeep
............此处省略465个文件信息
评论
共有 条评论