亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sbcdec.c

?? 這是Linux環境下的藍牙源代碼
?? C
字號:
/* * *  Bluetooth low-complexity, subband codec (SBC) decoder * *  Copyright (C) 2004-2008  Marcel Holtmann <marcel@holtmann.org> * * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA * */#ifdef HAVE_CONFIG_H#include <config.h>#endif#include <stdio.h>#include <errno.h>#include <fcntl.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <getopt.h>#include <sys/stat.h>#include <sys/ioctl.h>#include <sys/soundcard.h>#include "sbc.h"#define BUF_SIZE 8192static void decode(char *filename, char *output, int tofile){	unsigned char buf[BUF_SIZE], *stream;	struct stat st;	off_t filesize;	sbc_t sbc;	int fd, ad, pos, streamlen, framelen, count, written, len;	int format = AFMT_S16_BE, frequency, channels;	if (stat(filename, &st) < 0) {		fprintf(stderr, "Can't get size of file %s: %s\n",						filename, strerror(errno));		return;	}	filesize = st.st_size;	stream = malloc(st.st_size);	if (!stream) {		fprintf(stderr, "Can't allocate memory for %s: %s\n",						filename, strerror(errno));		return;	}	fd = open(filename, O_RDONLY);	if (fd < 0) {		fprintf(stderr, "Can't open file %s: %s\n",						filename, strerror(errno));		goto free;	}	if (read(fd, stream, st.st_size) != st.st_size) {		fprintf(stderr, "Can't read content of %s: %s\n",						filename, strerror(errno));		close(fd);		goto free;	}	close(fd);	pos = 0;	streamlen = st.st_size;	if (tofile)		ad = open(output, O_WRONLY | O_CREAT | O_TRUNC, 0644);	else		ad = open(output, O_WRONLY, 0);	if (ad < 0) {		fprintf(stderr, "Can't open output %s: %s\n",						output, strerror(errno));		goto free;	}	sbc_init(&sbc, 0L);	sbc.endian = SBC_BE;	framelen = sbc_decode(&sbc, stream, streamlen, buf, sizeof(buf), &len);	channels = sbc.mode == SBC_MODE_MONO ? 1 : 2;	switch (sbc.frequency) {	case SBC_FREQ_16000:		frequency = 16000;		break;	case SBC_FREQ_32000:		frequency = 32000;		break;	case SBC_FREQ_44100:		frequency = 44100;		break;	case SBC_FREQ_48000:		frequency = 48000;		break;	default:		frequency = 0;	}	printf("%d Hz, %d channels\n", frequency, channels);	if (!tofile) {		if (ioctl(ad, SNDCTL_DSP_SETFMT, &format) < 0) {			fprintf(stderr, "Can't set audio format on %s: %s\n",					output, strerror(errno));			goto close;		}		if (ioctl(ad, SNDCTL_DSP_CHANNELS, &channels) < 0) {			fprintf(stderr,				"Can't set number of channels on %s: %s\n",				output, strerror(errno));			goto close;		}		if (ioctl(ad, SNDCTL_DSP_SPEED, &frequency) < 0) {			fprintf(stderr, "Can't set audio rate on %s: %s\n",					output, strerror(errno));			goto close;		}	}	count = 0;	while (framelen > 0) {		/* we have completed an sbc_decode at this point sbc.len is the		 * length of the frame we just decoded count is the number of		 * decoded bytes yet to be written */		if (count + len >= BUF_SIZE) {			/* buffer is too full to stuff decoded audio in so it			 * must be written to the device */			written = write(ad, buf, count);			if (written > 0)				count -= written;		}		/* sanity check */		if (count + len >= BUF_SIZE) {			fprintf(stderr,				"buffer size of %d is too small for decoded"				" data (%d)\n", BUF_SIZE, len + count);			exit(1);		}		/* increase the count */		count += len;		/* push the pointer in the file forward to the next bit to be		 * decoded tell the decoder to decode up to the remaining		 * length of the file (!) */		pos += framelen;		framelen = sbc_decode(&sbc, stream + pos, streamlen - pos,					buf + count, sizeof(buf) - count,					&len);	}	if (count > 0) {		written = write(ad, buf, count);		if (written > 0)			count -= written;	}close:	sbc_finish(&sbc);	close(ad);free:	free(stream);}static void usage(void){	printf("SBC decoder utility ver %s\n", VERSION);	printf("Copyright (c) 2004-2008  Marcel Holtmann\n\n");	printf("Usage:\n"		"\tsbcdec [options] file(s)\n"		"\n");	printf("Options:\n"		"\t-h, --help           Display help\n"		"\t-v, --verbose        Verbose mode\n"		"\t-d, --device <dsp>   Sound device\n"		"\t-f, --file <file>    Decode to a file\n"		"\n");}static struct option main_options[] = {	{ "help",	0, 0, 'h' },	{ "device",	1, 0, 'd' },	{ "verbose",	0, 0, 'v' },	{ "file",	1, 0, 'f' },	{ 0, 0, 0, 0 }};int main(int argc, char *argv[]){	char *output = NULL;	int i, opt, verbose = 0, tofile = 0;	while ((opt = getopt_long(argc, argv, "+hvd:f:", main_options, NULL)) != -1) {		switch(opt) {		case 'h':			usage();			exit(0);		case 'v':			verbose = 1;			break;		case 'd':			if (output)				free(output);			output = strdup(optarg);			tofile = 0;			break;		case 'f' :			if (output)				free(output);			output = strdup(optarg);			tofile = 1;			break;		default:			exit(1);		}	}	argc -= optind;	argv += optind;	optind = 0;	if (argc < 1) {		usage();		exit(1);	}	for (i = 0; i < argc; i++)		decode(argv[i], output ? output : "/dev/dsp", tofile);	if (output)		free(output);	return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费看黄yyy456| 国产美女视频一区| 亚洲男同1069视频| 亚洲同性gay激情无套| 中文字幕亚洲电影| 自拍偷拍欧美激情| 天堂va蜜桃一区二区三区| 免费观看在线色综合| 国产高清精品网站| 91麻豆视频网站| 欧美一区二区精品| 中文字幕第一区综合| 亚洲精品综合在线| 精品一区二区三区日韩| 91免费看`日韩一区二区| 日韩一级片在线播放| 中文字幕电影一区| 色综合久久99| 日本韩国精品在线| 亚洲日穴在线视频| 99久久er热在这里只有精品15| 久久久亚洲精品一区二区三区 | 成年人国产精品| 中文字幕一区二区三区视频| 粉嫩高潮美女一区二区三区| 久久美女艺术照精彩视频福利播放 | 一区二区三区四区激情| 国产一区二区三区免费看 | 亚洲成人自拍偷拍| 色播五月激情综合网| 欧美激情中文字幕| 国产美女主播视频一区| 日韩欧美不卡一区| 精品一区二区成人精品| 久久嫩草精品久久久精品一| 亚洲国产wwwccc36天堂| 日本高清无吗v一区| 亚洲精品亚洲人成人网在线播放| 色综合久久天天| 亚洲主播在线观看| 69久久夜色精品国产69蝌蚪网| 日一区二区三区| 久久久久成人黄色影片| 波多野结衣一区二区三区| 中文字幕一区二区三区在线播放| 色又黄又爽网站www久久| 亚洲第一av色| 国产精品美日韩| 欧美久久久一区| 国产高清久久久| 日韩高清不卡一区二区三区| ww久久中文字幕| 欧美视频一区二区三区在线观看 | 69p69国产精品| 国产91对白在线观看九色| 亚洲精品网站在线观看| 91精品国产一区二区三区蜜臀| 国产乱码字幕精品高清av | 中文字幕av一区二区三区| 欧美性猛交一区二区三区精品| 国产一区二区在线电影| 亚洲成国产人片在线观看| 自拍偷拍亚洲综合| 国产无遮挡一区二区三区毛片日本| 欧美精品日韩一本| 99re8在线精品视频免费播放| 久久99精品视频| 午夜精品国产更新| 亚洲日本丝袜连裤袜办公室| 久久久久国产精品人| 正在播放亚洲一区| 91久久精品国产91性色tv| 国产成人精品网址| 精品亚洲porn| 国产剧情在线观看一区二区| 美腿丝袜亚洲综合| 久久99精品国产麻豆不卡| 五月天亚洲婷婷| 欧美aaaaa成人免费观看视频| 欧美96一区二区免费视频| 日本亚洲欧美天堂免费| 美洲天堂一区二卡三卡四卡视频 | 欧美日韩日日夜夜| 欧美日韩在线电影| 欧美午夜免费电影| 91精品久久久久久蜜臀| 精品国产91久久久久久久妲己| 欧美一区二区成人6969| 日韩一区二区视频| 国产精品传媒在线| 亚洲国产另类av| 国产河南妇女毛片精品久久久| 成人av网站免费观看| 日本精品一区二区三区高清 | 欧美大片在线观看一区二区| 欧美国产精品一区二区三区| 中文字幕日韩欧美一区二区三区| 伊人开心综合网| 国产精品1区2区3区| 欧美在线视频不卡| 精品国产乱码久久久久久闺蜜| 国产精品美女久久久久av爽李琼| 亚洲国产视频a| 成人91在线观看| 欧美精品一区二区不卡| 一级中文字幕一区二区| 成人深夜在线观看| 欧美成人vps| 久久精品国产精品亚洲综合| 国产精品18久久久久久vr | 国产精品美女久久久久久久网站| 亚洲综合清纯丝袜自拍| 777xxx欧美| 国产一区二区三区蝌蚪| 国产精品午夜免费| 色悠久久久久综合欧美99| 综合久久久久综合| 成人久久视频在线观看| 久久久无码精品亚洲日韩按摩| 视频一区二区欧美| 91福利视频久久久久| 1024成人网色www| 91热门视频在线观看| 国产精品欧美综合在线| 国模冰冰炮一区二区| 日韩欧美一二三四区| 国内不卡的二区三区中文字幕| 日韩欧美在线影院| 日韩精品久久久久久| 欧洲av一区二区嗯嗯嗯啊| 亚洲女同一区二区| 91理论电影在线观看| 精品福利av导航| 国产精品99久久不卡二区| 中文字幕一区二区不卡| 在线不卡中文字幕| 粉嫩av一区二区三区在线播放 | 国产欧美日韩中文久久| 成人午夜看片网址| 亚洲h动漫在线| 欧美激情资源网| 欧美日韩成人综合| 国产一区二区三区蝌蚪| 综合网在线视频| 91精品国产黑色紧身裤美女| 国产乱码精品一区二区三区av| 国产精品剧情在线亚洲| 欧美高清性hdvideosex| 不卡视频在线观看| 日产国产欧美视频一区精品| 久久久国产午夜精品| 欧美色中文字幕| 成人免费观看av| 丝袜美腿亚洲综合| 中文字幕亚洲综合久久菠萝蜜| 在线观看91av| 色婷婷激情综合| 国产福利一区二区三区在线视频| 亚洲国产中文字幕在线视频综合| 欧美精品一区二区三区蜜桃视频| 在线视频欧美精品| 色婷婷久久一区二区三区麻豆| 国产伦精品一区二区三区视频青涩| 午夜欧美视频在线观看| 亚洲线精品一区二区三区| 亚洲国产一区视频| 偷拍日韩校园综合在线| 日本aⅴ免费视频一区二区三区| 麻豆91在线播放| 菠萝蜜视频在线观看一区| 在线日韩av片| 精品蜜桃在线看| 亚洲精品乱码久久久久| 国内精品写真在线观看| 在线观看日产精品| 波多野结衣中文字幕一区二区三区| 亚洲同性同志一二三专区| 亚洲国产成人午夜在线一区 | 午夜视频一区二区| 亚洲v日本v欧美v久久精品| 日韩国产欧美在线视频| 免费欧美日韩国产三级电影| 另类小说图片综合网| 波波电影院一区二区三区| 色噜噜狠狠一区二区三区果冻| 欧洲亚洲精品在线| 精品国产精品一区二区夜夜嗨| 久久精品亚洲精品国产欧美 | 99re热视频精品| 欧美一级欧美一级在线播放| 国产日韩欧美精品电影三级在线| 亚洲欧洲日产国码二区| 午夜精品久久久| 成人精品一区二区三区中文字幕| 色噜噜夜夜夜综合网| 久久综合九色欧美综合狠狠| 亚洲欧美另类久久久精品| 久久国产精品99精品国产 | 一卡二卡欧美日韩| 丁香婷婷深情五月亚洲|