亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲精品精品亚洲| 国产一区三区三区| 一本大道久久a久久精二百| 国产精品丝袜久久久久久app| 丰满放荡岳乱妇91ww| 国产精品不卡在线| 在线看国产日韩| 男女性色大片免费观看一区二区 | 国产成人综合亚洲91猫咪| 精品电影一区二区| 不卡的看片网站| 亚洲一二三四区不卡| 91精品在线免费| 国产在线播放一区二区三区| 国产精品嫩草影院com| 欧洲一区在线观看| 久久www免费人成看片高清| 欧美高清在线一区二区| 欧美在线观看一二区| 免费精品视频最新在线| 中文一区在线播放| 欧美日韩一区在线观看| 国产一区二区在线免费观看| 国产精品家庭影院| 欧美群妇大交群的观看方式| 国产在线国偷精品产拍免费yy| 国产精品久久一卡二卡| 7777精品伊人久久久大香线蕉完整版 | 欧美一级一区二区| 国产盗摄精品一区二区三区在线| 亚洲精品免费在线播放| 日韩精品影音先锋| 91在线你懂得| 九九精品一区二区| 亚洲一区二区三区四区五区黄| 精品国内片67194| www激情久久| 91免费观看在线| 加勒比av一区二区| 亚洲成人午夜电影| 国产日本亚洲高清| 日韩视频在线一区二区| 99re这里只有精品首页| 精品在线一区二区| 亚洲成人综合视频| 中文字幕一区在线观看视频| 日韩精品最新网址| 欧美视频一区二区三区| 高潮精品一区videoshd| 日韩高清不卡在线| 亚洲另类在线视频| 国产日韩一级二级三级| 欧美精品久久99| 91久久免费观看| 成人性生交大片免费看在线播放 | 欧美一区二区三区在线电影| av亚洲精华国产精华精华| 麻豆国产精品777777在线| 亚洲一区二区四区蜜桃| 中文字幕在线不卡一区 | 日韩亚洲国产中文字幕欧美| 色综合天天做天天爱| 国产成人免费在线观看| 国内精品久久久久影院一蜜桃| 亚洲风情在线资源站| 亚洲卡通欧美制服中文| 国产精品第五页| 国产视频911| 久久久久久毛片| xnxx国产精品| 久久久www成人免费毛片麻豆| 91精品国产一区二区三区香蕉| 欧美日本在线一区| 欧美天天综合网| 欧美色倩网站大全免费| 欧美亚洲高清一区二区三区不卡| 91网站视频在线观看| 99久久婷婷国产综合精品| 成人国产精品免费观看视频| 成人性色生活片免费看爆迷你毛片| 国产一区二区导航在线播放| 精品一区二区三区日韩| 国内精品伊人久久久久av影院| 国内不卡的二区三区中文字幕| 久久国产福利国产秒拍| 国产在线看一区| 国产成人精品免费一区二区| 成人动漫精品一区二区| 欧美videos大乳护士334| 91.麻豆视频| 日韩视频一区二区三区| 久久午夜电影网| 中文字幕亚洲区| 一区二区三区视频在线观看| 亚洲高清视频中文字幕| 奇米777欧美一区二区| 韩国三级中文字幕hd久久精品| 国产91精品入口| 色94色欧美sute亚洲线路一ni| 欧美日韩不卡在线| 精品成人一区二区三区四区| 国产免费观看久久| 一区二区日韩av| 蜜桃av一区二区在线观看| 国产成人精品免费| 欧美性欧美巨大黑白大战| 欧美日韩国产综合一区二区三区| 欧美一级一级性生活免费录像| 国产亚洲欧美一区在线观看| 亚洲日韩欧美一区二区在线| 日韩精品一二区| av亚洲产国偷v产偷v自拍| 717成人午夜免费福利电影| 久久一区二区视频| 亚洲欧美日韩中文播放| 蜜桃精品视频在线观看| 91原创在线视频| 欧美变态凌虐bdsm| 亚洲欧美国产77777| 美女mm1313爽爽久久久蜜臀| heyzo一本久久综合| 这里是久久伊人| 亚洲欧美在线另类| 久久丁香综合五月国产三级网站| 91网站黄www| 久久毛片高清国产| 午夜久久福利影院| 欧美r级电影在线观看| 中文字幕一区二区三区四区| 午夜国产精品一区| 99精品欧美一区二区三区综合在线| 欧美精品在线观看一区二区| 国产精品午夜免费| 美女视频免费一区| 色综合久久久久网| 国产日韩av一区| 另类小说视频一区二区| 色香蕉久久蜜桃| 国产欧美一区二区精品忘忧草| 亚洲444eee在线观看| 91香蕉视频mp4| 中文字幕免费不卡| 国产在线视频一区二区三区| 51精品久久久久久久蜜臀| 亚洲裸体在线观看| 国产成人av一区二区三区在线观看| 欧美一区二区三区色| 亚洲综合在线五月| 94色蜜桃网一区二区三区| 久久精品综合网| 久久se精品一区二区| 91精品在线免费| 午夜av区久久| 欧美日韩一区精品| 亚洲一区二区综合| 欧美亚洲综合网| 亚洲欧美成人一区二区三区| 99精品视频免费在线观看| 中文字幕第一区二区| 精品一区二区影视| 欧美不卡一区二区| 欧美aaa在线| 日韩欧美中文一区二区| 日韩不卡手机在线v区| 91精品中文字幕一区二区三区| 午夜电影久久久| 91精品在线免费| 美女爽到高潮91| www国产亚洲精品久久麻豆| 激情五月婷婷综合网| 精品少妇一区二区| 国产在线精品一区二区夜色| 久久一区二区三区四区| 国产成人精品免费一区二区| 国产精品女人毛片| 日本韩国一区二区三区| 一区二区三区波多野结衣在线观看 | 国产欧美日韩不卡| 国产成人午夜精品影院观看视频 | 26uuu久久综合| 国产99久久久久久免费看农村| 青青草国产成人99久久| 91精品国产综合久久久久| 日本女人一区二区三区| 欧美mv和日韩mv的网站| 狠狠网亚洲精品| 国产精品私人自拍| 在线视频综合导航| 奇米色一区二区三区四区| 久久久综合视频| 91在线观看下载| 日韩电影一区二区三区| 久久综合99re88久久爱| av一区二区三区四区| 亚洲成人综合在线| xfplay精品久久| 色偷偷成人一区二区三区91| 三级亚洲高清视频| 国产亚洲美州欧州综合国| 色网综合在线观看|