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

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

?? adin_mic_darwin_coreaudio.c

?? julius version 4.12.about sound recognition.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/** * @file   adin_mic_darwin_coreaudio.c *  * <JA> * @brief  adin microphone library for CoreAudio API * * by Masatomo Hashimoto <m.hashimoto@aist.go.jp> * * Tested on Mac OS X v10.3.9 and v10.4.1 * * このプログラムは· * 迫惟乖蠟恕客 緩度禱窖另圭甫墊疥 攫鼠禱窖甫墊嬸嚏 * ユビキタスソフトウェアグル〖プ * より捏丁されましたˉ * </JA> *  * <EN> * @brief  adin microphone library for CoreAudio API * * by Masatomo Hashimoto <m.hashimoto@aist.go.jp> * * Tested on Mac OS X v10.3.9 and v10.4.1 * * This file has been contributed from the Ubiquitous Software Group, * Information Technology Research Institute, AIST. *  * </EN> *  * @author Masatomo Hashimoto * @date   Wed Oct 12 11:31:27 2005 * * $Revision: 1.2 $ *  *//* * adin_mic_darwin_coreaudio.c * * adin microphone library for CoreAudio API * * by Masatomo Hashimoto <m.hashimoto@aist.go.jp> * * Tested on Mac OS X v10.3.9 and v10.4.1 * *//* $Id: adin_mic_darwin_coreaudio.c,v 1.2 2007/12/18 08:45:50 sumomo Exp $ */#include <CoreAudio/CoreAudio.h>#include <AudioUnit/AudioUnit.h>#include <AudioUnit/AudioOutputUnit.h>#include <AudioToolbox/AudioConverter.h>#include <pthread.h>#include <stdio.h>#define DEVICE_NAME_LEN 128#define BUF_SAMPLES 4096static UInt32 ConvQuality = kAudioConverterQuality_Medium;typedef SInt16 Sample;static UInt32 BytesPerSample = sizeof(Sample);#define BITS_PER_BYTE 8static AudioDeviceID InputDeviceID;static AudioUnit InputUnit;static AudioConverterRef Converter;static pthread_mutex_t MutexInput;static pthread_cond_t CondInput;static bool CoreAudioRecordStarted = FALSE;static bool CoreAudioHasInputDevice = FALSE;static bool CoreAudioInit = FALSE;static UInt32 NumSamplesAvailable = 0;static UInt32 InputDeviceBufferSamples = 0;static UInt32 InputBytesPerPacket = 0;static UInt32 InputFramesPerPacket = 0;static UInt32 InputSamplesPerPacket = 0;static UInt32 OutputBitsPerChannel = 0;static UInt32 OutputBytesPerPacket = 0;static UInt32 OutputSamplesPerPacket = 0;static AudioBufferList* BufList;static AudioBufferList BufListBackup;static AudioBufferList* BufListConverted;#ifndef booleantypedef unsigned char boolean;#endifstatic void printStreamInfo(AudioStreamBasicDescription* desc) {  jlog("Stat: adin_darwin: ----- details of stream -----\n");  jlog("Stat: adin_darwin: sample rate: %f\n", desc->mSampleRate);  jlog("Stat: adin_darwin: format flags: %s%s%s%s%s%s%s\n", 	   desc->mFormatFlags & kAudioFormatFlagIsFloat ? 	   "[float]" : "",	   desc->mFormatFlags & kAudioFormatFlagIsBigEndian ? 	   "[big endian]" : "",	   desc->mFormatFlags & kAudioFormatFlagIsSignedInteger ? 	   "[signed integer]" : "",	   desc->mFormatFlags & kAudioFormatFlagIsPacked ? 	   "[packed]" : "",	   desc->mFormatFlags & kAudioFormatFlagIsAlignedHigh ? 	   "[aligned high]" : "",	   desc->mFormatFlags & kAudioFormatFlagIsNonInterleaved ? 	   "[non interleaved]" : "",	   desc->mFormatFlags & kAudioFormatFlagsAreAllClear ? 	   "[all clear]" : ""	   );  jlog("Stat: adin_darwin: bytes per packet: %d\n", desc->mBytesPerPacket);  jlog("Stat: adin_darwin: frames per packet: %d\n", desc->mFramesPerPacket);  jlog("Stat: adin_darwin: bytes per frame: %d\n", desc->mBytesPerFrame);  jlog("Stat: adin_darwin: channels per frame: %d\n", desc->mChannelsPerFrame);  jlog("Stat: adin_darwin: bits per channel: %d\n", desc->mBitsPerChannel);  jlog("Stat: adin_darwin: -----------------------------------\n");}static void printAudioBuffer(AudioBuffer* buf) {  int sz = buf->mDataByteSize / BytesPerSample;  int i;  Sample* p = (Sample*)(buf->mData);  for (i = 0; i < sz; i++) {    printf("%d ", p[i]);  }}static AudioBufferList* allocateAudioBufferList(UInt32 data_bytes, UInt32 nsamples, UInt32 nchan) {  AudioBufferList* bufl;#ifdef DEBUG  jlog("Stat: adin_darwin: allocateAudioBufferList: data_bytes:%d nsamples:%d nchan:%d\n",	   data_bytes, nsamples, nchan);#endif  bufl = (AudioBufferList*)(malloc(sizeof(AudioBufferList)));  if(bufl == NULL) {    jlog("Erorr: adin_darwin: allocateAudioBufferList: failed\n");    return NULL;  }  bufl->mNumberBuffers = nchan;  int i;  for (i = 0; i < nchan; i++) {    bufl->mBuffers[i].mNumberChannels = nchan;    bufl->mBuffers[i].mDataByteSize = data_bytes * nsamples;    bufl->mBuffers[i].mData = malloc(data_bytes * nsamples);        if(bufl->mBuffers[i].mData == NULL) {      jlog("Erorr: adin_darwin: allocateAudioBufferList: malloc for mBuffers[%d] failed\n", i);      return NULL;    }  }  return bufl;}/* gives input data for Converter */static OSStatus ConvInputProc(AudioConverterRef inConv,	      UInt32* ioNumDataPackets,	      AudioBufferList* ioData, // to be filled	      AudioStreamPacketDescription** outDataPacketDesc,	      void* inUserData){  int i;  UInt32 nPacketsRequired = *ioNumDataPackets;  UInt32 nBytesProvided = 0;  UInt32 nBytesRequired;  UInt32 n;    pthread_mutex_lock(&MutexInput);#ifdef DEBUG  jlog("Stat: adin_darwin: ConvInputProc: required %d packets\n", nPacketsRequired);#endif  while(NumSamplesAvailable == 0){    pthread_cond_wait(&CondInput, &MutexInput);  }  for(i = 0; i < BufList->mNumberBuffers; i++) {    n = BufList->mBuffers[i].mDataByteSize;    if (nBytesProvided != 0 && nBytesProvided != n) {      jlog("Warning: adin_darwin: buffer size mismatch\n");    }    nBytesProvided = n;  }#ifdef DEBUG  jlog("Stat: adin_darwin: ConvInputProc: %d bytes in buffer\n", nBytesProvided);#endif  for(i = 0; i < BufList->mNumberBuffers; i++) {    ioData->mBuffers[i].mNumberChannels =       BufList->mBuffers[i].mNumberChannels;    nBytesRequired = nPacketsRequired * InputBytesPerPacket;    if(nBytesRequired < nBytesProvided) {      ioData->mBuffers[i].mData = BufList->mBuffers[i].mData;      ioData->mBuffers[i].mDataByteSize = nBytesRequired;      BufList->mBuffers[i].mData += nBytesRequired;      BufList->mBuffers[i].mDataByteSize = nBytesProvided - nBytesRequired;    } else {      ioData->mBuffers[i].mData = BufList->mBuffers[i].mData;      ioData->mBuffers[i].mDataByteSize = nBytesProvided;            BufList->mBuffers[i].mData = BufListBackup.mBuffers[i].mData;    }  }  *ioNumDataPackets = ioData->mBuffers[0].mDataByteSize / InputBytesPerPacket;#ifdef DEBUG  jlog("Stat: adin_darwin: ConvInputProc: provided %d packets\n", *ioNumDataPackets);#endif  NumSamplesAvailable =     nBytesProvided / BytesPerSample - *ioNumDataPackets * InputSamplesPerPacket;#ifdef DEBUG  jlog("Stat: adin_darwin: ConvInputProc: %d samples available\n", NumSamplesAvailable);#endif  pthread_mutex_unlock(&MutexInput);  return noErr;}/* called when input data are available (an AURenderCallback) */static OSStatus InputProc(void* inRefCon,	  AudioUnitRenderActionFlags* ioActionFlags,	  const AudioTimeStamp* inTimeStamp,	  UInt32 inBusNumber,	  UInt32 inNumberFrames,	  AudioBufferList* ioData // null	  ){  OSStatus status = noErr;  int i;  pthread_mutex_lock(&MutexInput);  if (NumSamplesAvailable == 0) {    status = AudioUnitRender(InputUnit,			     ioActionFlags,			     inTimeStamp,			     inBusNumber,			     inNumberFrames,			     BufList);    NumSamplesAvailable =       BufList->mBuffers[0].mDataByteSize / InputBytesPerPacket;#ifdef DEBUG    printAudioBuffer(BufList->mBuffers);#endif  }  pthread_mutex_unlock(&MutexInput);    pthread_cond_signal(&CondInput);  /*  jlog("Stat: adin_darwin: InputProc: %d bytes filled (BufList)\n", 	  BufList->mBuffers[0].mDataByteSize);  */  return status;}/* initialize default sound device */boolean adin_mic_standby(int sfreq, void* dummy) {  OSStatus status;  UInt32 propertySize;  char deviceName[DEVICE_NAME_LEN];  struct AudioStreamBasicDescription inDesc;  int err;  jlog("Stat: adin_darwin: sample rate = %d\n", sfreq);  if (CoreAudioInit)     return TRUE;  Component halout;  ComponentDescription haloutDesc;  haloutDesc.componentType = kAudioUnitType_Output;  haloutDesc.componentSubType = kAudioUnitSubType_HALOutput;  haloutDesc.componentManufacturer = kAudioUnitManufacturer_Apple;  haloutDesc.componentFlags = 0;  haloutDesc.componentFlagsMask = 0;  halout = FindNextComponent(NULL, &haloutDesc);  if(halout == NULL) {    jlog("Error: adin_darwin: no HALOutput component found\n");    return FALSE;  }  OpenAComponent(halout, &InputUnit);  UInt32 enableIO;    enableIO = 1;  status = AudioUnitSetProperty(InputUnit, 				kAudioOutputUnitProperty_EnableIO,				kAudioUnitScope_Input,				1,				&enableIO,				sizeof(enableIO));    if (status != noErr) {      jlog("Error: adin_darwin: cannot set InputUnit's EnableIO(Input)\n");      return FALSE;    }  enableIO = 0;  status = AudioUnitSetProperty(InputUnit, 				kAudioOutputUnitProperty_EnableIO,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91亚洲国产成人精品一区二三| 亚洲国产精品99久久久久久久久 | 亚洲免费成人av| 精品国精品国产尤物美女| 欧美人妇做爰xxxⅹ性高电影| caoporen国产精品视频| 亚洲国产成人在线| 99久久99久久精品免费观看 | 国产不卡在线一区| 麻豆精品久久精品色综合| 日本最新不卡在线| 久久精品二区亚洲w码| 久久成人免费网| 极品少妇xxxx偷拍精品少妇| 久久精品噜噜噜成人av农村| 久久99久久久久| 国产在线国偷精品产拍免费yy| 日本成人在线一区| 免费视频一区二区| 久久国产成人午夜av影院| 韩国欧美一区二区| 国产伦精品一区二区三区视频青涩| 欧美a级理论片| 麻豆国产精品视频| 国产资源精品在线观看| 国产白丝精品91爽爽久久| 丁香婷婷综合五月| 91亚洲国产成人精品一区二三 | 制服丝袜日韩国产| 日韩精品一区二区三区视频| 久久精品视频在线看| 国产精品久久影院| 亚洲视频一区在线观看| 亚洲成国产人片在线观看| 久久99精品久久久久久| 国产 欧美在线| 在线观看日韩国产| 91精品欧美综合在线观看最新| 91精品国产91综合久久蜜臀| 久久综合色之久久综合| 亚洲人成亚洲人成在线观看图片| 亚洲欧美日韩国产一区二区三区| 一区二区视频在线| 亚洲欧洲精品成人久久奇米网| 国产91精品精华液一区二区三区 | 日韩精品在线看片z| 天天色 色综合| 久久成人综合网| 国内精品免费**视频| 国产在线播精品第三| 欧美日韩精品二区第二页| 91精品国产91久久综合桃花| 1区2区3区精品视频| 中文字幕一区二区三区不卡在线| 日韩无一区二区| youjizz久久| 色伊人久久综合中文字幕| 欧美一级国产精品| 亚洲综合免费观看高清完整版在线 | 青青草成人在线观看| 成人av第一页| 亚洲乱码国产乱码精品精可以看 | 国产精品亚洲成人| 中文无字幕一区二区三区 | 国产精品久久久久精k8| 成人黄色免费短视频| 国产精品久久一级| 国产成人精品在线看| 精品久久久影院| 精品一区二区av| 中文字幕乱码久久午夜不卡| 99久久夜色精品国产网站| 国产精品美女一区二区三区 | 欧美久久久久久久久中文字幕| 欧美日韩另类一区| 国产精品欧美精品| 国产精品资源在线| 综合亚洲深深色噜噜狠狠网站| 国产黄色91视频| 欧美精品vⅰdeose4hd| 一区二区三区高清| 国产大陆精品国产| 91精品国产综合久久久久久久| 国产亚洲一区二区三区四区| 国产成人午夜电影网| 国产精品传媒视频| 亚洲日本丝袜连裤袜办公室| 色综合中文综合网| 一本大道久久a久久精二百| 一区二区三区 在线观看视频| 日韩一区二区精品| 91在线精品一区二区| 亚洲电影中文字幕在线观看| 日韩一级大片在线观看| 国产精品91一区二区| 日本免费新一区视频 | 亚洲免费在线看| 色综合久久九月婷婷色综合| 日韩精品每日更新| 国产精品色哟哟网站| 欧美性猛交xxxx乱大交退制版| 欧美人成免费网站| 一区二区成人在线观看| 97精品电影院| 综合色中文字幕| 99久久久久久| 亚洲欧美日韩国产手机在线| 色偷偷成人一区二区三区91| 尤物在线观看一区| 欧美亚洲精品一区| 日欧美一区二区| 精品视频一区 二区 三区| 亚洲综合免费观看高清完整版在线| 成人激情黄色小说| 综合久久综合久久| 欧洲av一区二区嗯嗯嗯啊| 亚洲h精品动漫在线观看| 91.麻豆视频| 精品一区二区免费| 国产欧美日韩精品在线| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 欧美一区二区三区系列电影| 亚洲一区二区高清| 欧美一区日韩一区| 国产美女精品人人做人人爽| 亚洲国产成人午夜在线一区| 97se狠狠狠综合亚洲狠狠| 亚洲美女屁股眼交3| 欧美日韩夫妻久久| 久久精品99国产精品日本| 久久精品亚洲精品国产欧美kt∨| 国产精品资源网| 亚洲人成人一区二区在线观看| www.日韩精品| 亚洲6080在线| www国产成人免费观看视频 深夜成人网| 久久69国产一区二区蜜臀| 中文一区二区在线观看| 欧美私人免费视频| 久久99久国产精品黄毛片色诱| 国产亚洲一二三区| 在线一区二区三区做爰视频网站| 亚洲国产va精品久久久不卡综合| 91精品国产乱码久久蜜臀| 国产一区二区在线观看免费 | 曰韩精品一区二区| 日韩欧美在线不卡| 不卡视频一二三| 日韩电影在线一区二区三区| 日本一区二区三区免费乱视频| 一本大道av伊人久久综合| 日韩电影在线看| 日本一区二区高清| 欧美色中文字幕| 国产福利一区在线观看| 亚洲图片欧美视频| 国产欧美日韩卡一| 538在线一区二区精品国产| 成人毛片在线观看| 日本不卡一二三| 亚洲欧美日韩精品久久久久| 日韩欧美一区电影| 在线视频你懂得一区二区三区| 日韩**一区毛片| 综合电影一区二区三区| 欧美精品一区二区精品网| 在线观看av不卡| 成人久久视频在线观看| 蜜臀久久久久久久| 夜夜夜精品看看| 国产精品久久久久影视| 日韩欧美一区二区久久婷婷| 欧美综合一区二区三区| 国产 欧美在线| 狠狠色狠狠色综合| 日韩国产高清影视| 亚洲伊人色欲综合网| 国产精品久久久久永久免费观看 | 一区二区三区欧美| 国产精品情趣视频| 精品国产凹凸成av人网站| 欧美性欧美巨大黑白大战| 成人黄色在线视频| 国产一区二区不卡老阿姨| 免费欧美在线视频| 亚洲国产成人高清精品| 中文字幕一区二区三区不卡 | 成人欧美一区二区三区在线播放| 欧美一级搡bbbb搡bbbb| 在线观看日产精品| 色综合中文字幕国产| 国产成人av自拍| 韩国精品一区二区| 久热成人在线视频| 日本不卡一二三| 蜜桃av噜噜一区二区三区小说| 一区二区免费视频| 亚洲精品日日夜夜| 亚洲卡通动漫在线| 亚洲免费看黄网站|