html读写excle文档
1、faac
example
./configure --prefix=$(pwd)/_install
make
make install
/* aac_encode.c */
#include <stdio.h>
#include <faac.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h> int main (int argc, char **argv)
{
unsigned long sampleRate = 8000;
unsigned int numChannels = 1;
unsigned long inputSample = 0;
unsigned long maxOutputBytes = 0;
faacEncHandle encoder;
faacEncConfigurationPtr config;
FILE *rfile = NULL;
FILE *wfile = NULL;
int16_t *pcm_input = NULL;
uint8_t *aac_output = NULL;
int readcount = 0;
int writecount = 0; encoder = faacEncOpen(sampleRate, numChannels, &inputSample, &maxOutputBytes);
config = faacEncGetCurrentConfiguration(encoder);
config->aacObjectType = MAIN;
config->mpegVersion = MPEG4;
config->useLfe = 0;
config->useTns = 1;
config->allowMidside = 1;
/*RAW_STREAM=0, ADTS_STREAM=1*/
config->outputFormat = 1;
config->bitRate = sampleRate;
config->inputFormat = FAAC_INPUT_16BIT;
faacEncSetConfiguration(encoder, config); printf("sampleRate:%ld, numChannels:%d, inputSample:%ld, maxOutputBytes:%ld\n",
sampleRate, numChannels, inputSample, maxOutputBytes); if (argv[1]) {
rfile = fopen(argv[1], "rb");
} else {
printf("try to open input.pcm\n");
rfile = fopen("input.pcm", "rb");
} if (!rfile) {
printf("open error\n");
goto end;
} if (argv[2]) {
wfile = fopen(argv[2], "wb");
} else {
printf("try to open output.aac\n");
wfile = fopen("output.aac", "wb");
} if (!wfile) {
printf("open error\n");
goto end;
} pcm_input = (int16_t *)malloc(inputSample * sizeof(int16_t));
aac_output = (uint8_t *)malloc(maxOutputBytes * sizeof(uint8_t)); /* encode */
while (1) {
int readlen = 0;
int ret = 0; readlen = fread(pcm_input, sizeof(int16_t), inputSample, rfile); ret = faacEncEncode(encoder, (int32_t *)pcm_input, readlen, aac_output, maxOutputBytes); if (ret > 0) {
fwrite(aac_output, sizeof(uint8_t), ret, wfile);
} else if (ret < 0) {
printf("encode error\n");
break;
} readcount += readlen * 2;
writecount += ret; if (!readlen && !ret) {
printf("encode complete, from %d bytes to %d bytes\n", readcount, writecount);
break;
}
} free(pcm_input);
free(aac_output); end:
if (wfile) fclose(wfile);
if (rfile) fclose(rfile);
faacEncClose(encoder);
return 0;
}
Makefile
APP = main
INCLUDE = \
-I ./faac/include
LIB = \
-L ./faac/lib/
SRC = main.c
CFLAGS =
LDFLAGS = -lfaac
out: 
    gcc $(SRC) -o $(APP) $(LIB) $(INCLUDE) $(CFLAGS) $(LDFLAGS)
clean:
    rm -rf *o *.out $(APP)
2、faac/faad <--- > pcm
https://www.audiocoding.com/downloads.html
3、g711 <---> pcm
https://github.com/phoenixZZZ/G711_EncodecAndDecodec
https://github.com/Wenstery/G711AudioStream
https://github.com/escrichov/G711
codec-for-audio-in-G72X-G711-G723-G726-G729
非常好的实例,已经用在产品里了,感谢作者!
An ANSI C library for encoding/decoding using the A-law and u-Law.
https://github.com/dystopiancode/pcm-g711
https://blog.csdn.net/szfhy/article/details/52448906
html读写excle文档的更多相关文章
- 使导出excle文档实现ALT+Enter的效果()
		JAVA中输入什么转义字符,使导出excle文档实现ALT+Enter的效果?或者有没有其他方法可以实现. 20 JAVA中输入什么转义字符,使导出excle文档实现ALT+Enter的效果?或者有没 ... 
- C#操作Xml:通过XmlDocument读写Xml文档
		什么是Xml? Xml是扩展标记语言的简写,是一种开发的文本格式.关于它的更多情况可以通过w3组织了解http://www.w3.org/TR/1998/REC-xml-19980210.如果你不知道 ... 
- dom4j读写XML文档
		dom4j 最常用最简单的用法(转) 要使用dom4j读写XML文档,需要先下载dom4j包,dom4j官方网站在 http://www.dom4j.org/目前最新dom4j包下载地址:http:/ ... 
- python+selenium自动化软件测试(第12章):Python读写XML文档
		XML 即可扩展标记语言,它可以用来标记数据.定义数据类型,是一种允许用户对自己的标记语言进 行定义的源语言.xml 有如下特征: 首先,它是有标签对组成:<aa></aa> ... 
- Docx组件读写Word文档介绍
		Docx介绍 官方原文:DocX is a .NET library that allows developers to manipulate Word 2007/2010/2013 files, i ... 
- BCB 读写Word文档
		void __fastcall TForm1::btn1Click(TObject *Sender) { Variant WordApp,WordDocs,WordDoc; Variant word_ ... 
- 读写XML文档时,去掉新增加节点的“空命名空间”(xmlns=””)
		在做对ReprotViewer编程时,想做一个用户可以更改显示/打印列的功能,大致看了下,只需要通过对rdlc文件中改变其<Hidden>节点值为false/true,即可实现对应某列的显 ... 
- 通过XmlDocument读写Xml文档参考地址
		/// <summary> /// 获取一个报表的参数 http://blog.csdn.net/hdhai9451/article/details/12170069 /// </s ... 
- $用python-docx模块读写word文档
		工作中会遇到需要读取一个有几百页的word文档并从中整理出一些信息的需求,比如产品的API文档一般是word格式的.几百页的文档,如果手工一个个去处理,几乎是不可能的事情.这时就要找一个库写脚本去实现 ... 
随机推荐
- thinkphp  如何调用百度echarts 数据报表插件
			echarts官网网址:http://echarts.baidu.com/ echarts源码地址:http://echarts.baidu.com/build/echarts-2.2.7.zip ... 
- MS SQL Server2012中的EOMONTH函数
			MS SQL Server2012中的EOMONTH函数 这个函数是获取一个指定日期所在月份最后一天的日期.可以得到某一个月月份的最后一天 如: declare @orderdate date=' ... 
- mac下MAMP的安装和使用
			详情博客:https://my.oschina.net/laiconglin/blog/514139 
- C# winform 中MessageBox用法大全(附效果图)
			我们在程序中经常会用到MessageBox. MessageBox.Show()共有21中重载方法.现将其常见用法总结如下: 1.MessageBox.Show(“Hello~~~~”); 最简单的, ... 
- XML Publiser For Excel Template
			1.XML Publisher定义数据 2.XML Publisher定义模板 模板类型选择Microsoft Excel,默认输出类型选择Excel,上传.xls模板 3.定义并发程序 4.定义请求 ... 
- 编程之美 set 17 拈游戏分析 (2)
			题目 有 N 块石头河两个玩家 A 和 B. A 先将石头分成若干堆, 然后按照 BABABA... 的顺序轮流取石块, 能将剩下的石头依次取光的玩家获胜. 每次取石头时, 每个玩家只能取一堆的 m( ... 
- 【黑金原创教程】【Modelsim】【第五章】仿真就是人生
			声明:本文为黑金动力社区(http://www.heijin.org)原创教程,如需转载请注明出处,谢谢! 黑金动力社区2013年原创教程连载计划: http://www.cnblogs.com/al ... 
- 【BZOJ1857】[Scoi2010]传送带 三分套三分
			[BZOJ1857][Scoi2010]传送带 Description 在一个2维平面上有两条传送带,每一条传送带可以看成是一条线段.两条传送带分别为线段AB和线段CD.lxhgww在AB上的移动速度 ... 
- you *might* want to use the less safe log_bin_trust_function_creators variable
			报错:you *might* want to use the less safe log_bin_trust_function_creators variable 解决方法如下: 1. mysql&g ... 
- SQL server 数据库升级版本问题解决办法
			在升级或安装数据库的时候,会遇到数据库版本不对的问题,无论怎么升级,升级提示成功了,但打开数据库发现还是原来那个版本.甚至出现重装数据库之后,登陆页面已经提示安装的是新版本了,但登陆进去之后,发现数据 ... 
