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格式的.几百页的文档,如果手工一个个去处理,几乎是不可能的事情.这时就要找一个库写脚本去实现 ...
随机推荐
- sql循环插入测试数据
declare @i int set @i=1while @i<61 begin insert into T_RolePower values(1,@i,1)set @i=@i+1 end
- phpstorm 中文版 支持BUG调试 IDE
下载地址:http://dx2.7down.net/soft/P/phpstorm8_cn.zip
- cssText方式写入css
<div class="a" id="a">hello world</div> <script> //通过JS来覆写对象的样 ...
- Statement和PreparedStatement都是用来发送和执行SQL语句的
Statement和PreparedStatement都是用来发送和执行SQL语句的 DriverManager管理一组驱动程序
- malloc 函数本身并不识别要申请的内存是什么类型
malloc 函数本身并不识别要申请的内存是什么类型,它只关心内存的总字节数.我 们通常记不住 int, float 等数据类型的变量的确切字节数. 例如 int 变量在 16 位系统 下是 2 个字 ...
- i2c 异常之i2c1 prob 检测超时
在没加atl 的fpga 时 i2c1上的tvp5150 vpss驱动加载没问题, 加了之后出现超时 I2C: timed out in wait_for_bb: I2C_IRQSTATUS=1000 ...
- 插件之下拉框Select2
select2为代替常规的select而出现,可自定义select的样式,最明显的功能就是集合中可以搜索 关于浏览器要求,ie8+,Chrome 8+,Firefox 10+,Safari 3+,Op ...
- unity发射弓箭轨迹的实现
无论是愤怒的小鸟,还是弓箭发射功能,亦或者模拟炮弹受重力影响等抛物线轨迹,都可以使用本文的方法,模拟绝对真实. 和往常一样,先说原理.就是抛物运动,在垂直方向上做加速度运动,在水平方向上,做匀速运动. ...
- C++ 智能指针学习
C++ Code 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 ...
- solr初认识
Solr : Search On Lucene Replication Solr 基本概况 Apache Solr (读音: SOLer) 是一个开源的搜索服务器.Solr 使用 Java 语言开发, ...