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

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

?? sound.c

?? Ming is a library for generating Macromedia Flash files (.swf), written in C, and includes useful ut
?? C
字號:
/*    Ming, an SWF output library    Copyright (C) 2002  Opaque Industries - http://www.opaque.net/    This library is free software; you can redistribute it and/or    modify it under the terms of the GNU Lesser General Public    License as published by the Free Software Foundation; either    version 2.1 of the License, or (at your option) any later version.    This library 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    Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public    License along with this library; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*//* $Id: sound.c,v 1.22 2008/09/08 10:20:34 krechert Exp $ */#include <stdio.h>#include <stdlib.h>#include "outputblock.h"#include "sound.h"#include "soundstream.h"#include "character.h"#include "method.h"#include "input.h"#include "libming.h"#include "mp3.h"struct SWFSound_s{	struct SWFCharacter_s character;	byte flags;	byte isFinished;	int numSamples;	int seekSamples;	int samplesPerFrame;	byte freeInput;	SWFInput input;	byte *data;	struct SWFSoundStream_s *soundStream;};voidwriteSWFSoundWithSoundStreamToMethod(SWFSoundStream stream,	SWFByteOutputMethod method, void *data);static intsoundDataSize(SWFSound sound){	if ((sound->flags&SWF_SOUND_COMPRESSION) == SWF_SOUND_NOT_COMPRESSED ||		 (sound->flags&SWF_SOUND_COMPRESSION) == SWF_SOUND_NOT_COMPRESSED_LE)	{		int sampleCount = SWFInput_length(sound->input);		if ((sound->flags & SWF_SOUND_BITS) == SWF_SOUND_16BITS)			sampleCount /= 2;		if ((sound->flags & SWF_SOUND_CHANNELS) == SWF_SOUND_STEREO)			sampleCount /= 2;		return sampleCount;	}	else if ((sound->flags&SWF_SOUND_COMPRESSION) == SWF_SOUND_ADPCM_COMPRESSED)	{		int filesize, channels, nbits;		int bitsize, blocksize, n, res, m;		SWF_assert((sound->flags & SWF_SOUND_BITS) == SWF_SOUND_16BITS);		filesize = SWFInput_length(sound->input);		if ((sound->flags&SWF_SOUND_CHANNELS) == SWF_SOUND_MONO)			channels = 1;		else if ((sound->flags & SWF_SOUND_CHANNELS) == SWF_SOUND_STEREO)			channels = 2;		else			channels = 1;	 /* ? */		nbits = 4;	/* XXX - testing.. */		/*		 * Estimation of the sample count in ADPCM data from file size of the data.		 * This is an approximate calculation.		 */		bitsize = 8 * filesize - (2 + (8 - 1));		/* 2: header, (8 - 1): possible padding */		blocksize = ((16 + 6) + nbits * 4095) * channels;		n = bitsize / blocksize;		res = bitsize % blocksize;		m = (res - (16 + 6) * channels) / (nbits * channels);		return 4096 * n + m;	}	else if ((sound->flags&SWF_SOUND_COMPRESSION) == SWF_SOUND_MP3_COMPRESSED)	{		int pos = SWFInput_tell(sound->input);		int samples = -1;		getMP3Samples(sound->input, sound->flags, &samples);		SWFInput_seek(sound->input, pos, SEEK_SET);		return samples;	}	else 	{		SWF_warn("SWFSound: can't determine sampleCount\n");		return 0;	}}voidwriteSWFSoundToStream(SWFBlock block, SWFByteOutputMethod method, void *data){	int l, i;	SWFSound sound = (SWFSound)block;	methodWriteUInt16(CHARACTERID(sound), method, data);	method(sound->flags, data);	l = SWFInput_length(sound->input);	methodWriteUInt32(soundDataSize(sound), method, data);	if ( (sound->flags & SWF_SOUND_COMPRESSION) == SWF_SOUND_MP3_COMPRESSED )		methodWriteUInt16(sound->seekSamples, method, data);		/* write samples */	for ( i=0; i<l; ++i )		method((unsigned char)SWFInput_getChar(sound->input), data);}intcompleteDefineSWFSoundBlock(SWFBlock block){	SWFSound sound = (SWFSound)block;	if ((sound->flags&SWF_SOUND_COMPRESSION) == SWF_SOUND_MP3_COMPRESSED)		return 7 + 2 + SWFInput_length(sound->input);	else		return 7 + SWFInput_length(sound->input);}voidwriteSWFSoundWithSoundStreamToStream(SWFBlock block, SWFByteOutputMethod method, void *data){	SWFSound sound = (SWFSound)block;	methodWriteUInt16(CHARACTERID(sound), method, data);	method(sound->flags, data);	writeSWFSoundWithSoundStreamToMethod(sound->soundStream, method, data);}intcompleteDefineSWFSoundWithSoundStreamBlock(SWFBlock block){	SWFSound sound = (SWFSound)block;	int len = SWFSoundStream_getLength(sound->soundStream, 0) + 9;	SWFSoundStream_rewind(sound->soundStream);	return len;}voiddestroySWFSound(SWFSound sound){	if (sound->freeInput)		destroySWFInput(sound->input);	destroySWFCharacter((SWFCharacter) sound);}/* * Creates a new EventSound object. * * The sound to be played is contained in a file and specified with flags. * * Flags must contain a sound format, sampling rate, size (in bits) and channels. * If the file contains mp3 data it is not necessary to specify sampling rate,  * sound size and channels. * * Possible sound formats are: * - SWF_SOUND_NOT_COMPRESSED  * - SWF_SOUND_ADPCM_COMPRESSED * - SWF_SOUND_MP3_COMPRESSED * - SWF_SOUND_NOT_COMPRESSED_LE * - SWF_SOUND_NELLY_COMPRESSED * * Sampling rate must be one of the following values: * - SWF_SOUND_5KHZ * - SWF_SOUND_11KHZ * - SWF_SOUND_22KHZ * - SWF_SOUND_44KHZ * * Sound size is either SWF_SOUND_8BITS or SWF_SOUND_16BITS * Channels are either SWF_SOUND_MONO or SWF_SOUND_STEREO */SWFSoundnewSWFSound(FILE *f, byte flags){	SWFSound s = newSWFSound_fromInput(newSWFInput_file(f), flags);	s->freeInput = TRUE;	return s;}/* added by David McNab <david@rebirthing.co.nz> *//* required so that python can pass in file descriptors instead of FILE* streams */SWFSoundnewSWFSoundFromFileno(int fd, byte flags){	FILE *fp = fdopen(fd, "r");	return newSWFSound(fp, flags);}SWFSoundnewSWFSound_fromInput(SWFInput input, byte flags){	SWFSound sound = (SWFSound)malloc(sizeof(struct SWFSound_s));	SWFBlock block = (SWFBlock)sound;	SWFCharacterInit((SWFCharacter)sound);	CHARACTERID(sound) = ++SWF_gNumCharacters;	block->type = SWF_DEFINESOUND;	block->writeBlock = writeSWFSoundToStream;	block->complete = completeDefineSWFSoundBlock;	block->dtor = (destroySWFBlockMethod) destroySWFSound;	sound->input = input;	sound->flags = flags;	if((sound->flags&SWF_SOUND_COMPRESSION) == SWF_SOUND_MP3_COMPRESSED)	{		if(getMP3Flags(input, &sound->flags) < 0)		{			free(sound);			return NULL;		}	}	sound->soundStream = 0;	sound->seekSamples = SWFSOUND_INITIAL_DELAY;	sound->freeInput = FALSE;	return sound;}/* * Creates an Event Sound object from a given SoundStream object * * see also newSWFSoundStream() */SWFSoundnewSWFSound_fromSoundStream(SWFSoundStream stream){	SWFSound sound = (SWFSound)malloc(sizeof(struct SWFSound_s));	SWFBlock block = (SWFBlock)sound;	SWFCharacterInit((SWFCharacter)sound);	CHARACTERID(sound) = ++SWF_gNumCharacters;	block->type = SWF_DEFINESOUND;	block->writeBlock = writeSWFSoundWithSoundStreamToStream;	block->complete = completeDefineSWFSoundWithSoundStreamBlock;	block->dtor = (destroySWFBlockMethod) destroySWFSound;	sound->input = 0;	sound->flags = SWFSoundStream_getFlags(stream);	sound->soundStream = stream;	return sound;}voidSWFSound_setData(SWFSound sound, byte flags, int numSamples, byte *data){	sound->flags = flags;	sound->numSamples = numSamples;	sound->data = data;}/* * Local variables: * tab-width: 2 * c-basic-offset: 2 * End: */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品电影在线| 国产日韩精品一区二区三区在线| 国产精品一区二区三区乱码| 日韩av一区二区三区| 日韩在线a电影| 亚洲国产裸拍裸体视频在线观看乱了| 亚洲乱码国产乱码精品精可以看 | 亚洲国产中文字幕在线视频综合 | 精品国产网站在线观看| 制服.丝袜.亚洲.另类.中文| 欧美丝袜丝交足nylons图片| 在线观看中文字幕不卡| 欧美高清hd18日本| 日韩欧美综合一区| 国产视频视频一区| 国产精品毛片a∨一区二区三区| 日本一区二区免费在线 | 国产凹凸在线观看一区二区| 国产福利视频一区二区三区| 成人激情视频网站| 在线一区二区三区做爰视频网站| 欧美在线一区二区| 欧美福利视频一区| 亚洲国产高清不卡| 午夜精品福利一区二区蜜股av| 美女视频黄频大全不卡视频在线播放| 国产在线乱码一区二区三区| 国产真实乱对白精彩久久| 成人精品在线视频观看| 91久久一区二区| 欧美美女一区二区三区| 久久久噜噜噜久久中文字幕色伊伊| 中文字幕第一区二区| 亚洲午夜精品久久久久久久久| 视频一区在线视频| 国产精品自产自拍| 色国产综合视频| 日韩免费观看高清完整版 | 91片在线免费观看| 8x8x8国产精品| 国产精品丝袜一区| 丝袜美腿亚洲综合| 国产成人精品影院| 欧美日韩精品高清| 国产精品剧情在线亚洲| 日韩影院在线观看| 99久久久精品| 国产肉丝袜一区二区| 五月婷婷综合网| 99麻豆久久久国产精品免费优播| 欧美一区二区在线不卡| 中文字幕av一区 二区| 人妖欧美一区二区| 92国产精品观看| 国产日韩欧美一区二区三区乱码| 亚洲福利一区二区| 91蝌蚪国产九色| 国产精品免费网站在线观看| 久久精品国产999大香线蕉| 在线中文字幕一区| 中文字幕一区二区三区四区| 国产在线视视频有精品| 日韩欧美一卡二卡| 亚洲在线免费播放| 一本到不卡免费一区二区| 欧美国产成人在线| 国产成人精品影院| 国产日韩精品久久久| 精品夜夜嗨av一区二区三区| 欧美一区二区三区啪啪| 日本午夜精品视频在线观看| 欧美日韩中文另类| 一区二区三区欧美日| 波多野结衣视频一区| 亚洲欧洲性图库| 91免费在线视频观看| 亚洲视频在线观看一区| 91视频免费看| 亚洲欧美激情视频在线观看一区二区三区| 风间由美性色一区二区三区| 久久精品在线观看| 国产九色sp调教91| 欧美国产一区视频在线观看| 国产成人免费视频网站| 国产精品三级久久久久三级| 成人动漫在线一区| 综合久久国产九一剧情麻豆| 91网站在线观看视频| 亚洲美女免费视频| 日本高清成人免费播放| 亚洲妇熟xx妇色黄| 精品久久人人做人人爰| 国产成人综合精品三级| 国产亚洲欧美日韩在线一区| 国产一区二区在线看| 欧美高清在线一区| 91碰在线视频| 视频一区欧美精品| 91精品国产综合久久婷婷香蕉| 日韩国产一区二| 26uuu久久综合| 日本aⅴ亚洲精品中文乱码| 欧美在线观看一二区| 美女性感视频久久| 日韩视频中午一区| 大桥未久av一区二区三区中文| 中文字幕一区二区在线观看| 欧美综合久久久| 狠狠色伊人亚洲综合成人| 国产精品美女久久久久久久| 欧美视频你懂的| 国产在线国偷精品产拍免费yy| 国产精品三级av| 欧美美女喷水视频| 国产91清纯白嫩初高中在线观看| 亚洲久本草在线中文字幕| 日韩久久精品一区| 97成人超碰视| 狠狠久久亚洲欧美| 亚洲免费av观看| 欧美精品一区二区在线观看| 欧美中文字幕一二三区视频| 国产精品一二三四| 午夜精品久久久久影视| 国产精品美女久久久久av爽李琼| 日韩一区二区电影网| av毛片久久久久**hd| 在线免费一区三区| 国产精品白丝av| 国产一区二区三区| 一区二区三区四区不卡在线 | 成人免费高清在线观看| 亚洲一区二区偷拍精品| 中文字幕乱码久久午夜不卡 | 久久欧美一区二区| 欧美色视频一区| 成人黄色国产精品网站大全在线免费观看 | 欧美一区二区三区在线视频| caoporn国产精品| 国产精品一品视频| 另类综合日韩欧美亚洲| 亚洲国产日产av| 亚洲精品视频免费观看| 国产精品毛片久久久久久| 国产亚洲一二三区| 久久蜜臀精品av| 精品国产一区二区三区忘忧草| 在线播放日韩导航| 欧美精品日韩一区| 在线一区二区三区四区五区| 色综合夜色一区| 91在线视频网址| 色婷婷av一区| 色香蕉成人二区免费| 9i在线看片成人免费| 99在线热播精品免费| 国产精品123区| 粉嫩aⅴ一区二区三区四区五区| 国产曰批免费观看久久久| 国产一区二区日韩精品| 国产成人免费在线视频| 国产91丝袜在线播放| 丁香激情综合五月| 色哟哟国产精品免费观看| 欧美影院一区二区三区| 欧美三级三级三级| 欧美xxxxx牲另类人与| 精品999久久久| 欧美激情一区二区在线| 中文字幕一区二区视频| 一区二区三区精品视频| 婷婷国产v国产偷v亚洲高清| 日本视频免费一区| 丁香一区二区三区| 色94色欧美sute亚洲线路二| 91麻豆精品国产无毒不卡在线观看| 日韩女优电影在线观看| 精品伦理精品一区| 亚洲欧洲精品一区二区三区不卡| 亚洲免费av在线| 毛片av一区二区三区| 成人国产精品视频| 91成人免费网站| 亚洲精品在线观看视频| 国产精品区一区二区三区 | 欧美一卡在线观看| 国产欧美一区视频| 夜色激情一区二区| 国产原创一区二区三区| 91麻豆国产福利在线观看| 欧美三级蜜桃2在线观看| 久久亚洲二区三区| 亚洲精选视频免费看| 经典三级在线一区| 91麻豆成人久久精品二区三区| 欧美日韩国产美| 国产精品久久久久天堂| 日韩电影在线观看网站| hitomi一区二区三区精品| 日韩欧美一级二级三级久久久|