iPhone/iPad开发扎记 2012/02/21
来源:互联网 发布:mac mini 蓝牙 天线 编辑:程序博客网 时间:2024/06/04 18:34
1. playing *.pcm in iOS
* EXC_BAD_ACCESS
http://www.cocoachina.com/macdev/objc/2011/0219/2661.html
Q:设置NSZombieEnabled后,仍然没有crash的线索。
* thought:
可能是因为audio queue buffer没有初始化造成的。
see the following article: http://www.cnblogs.com/lovecode/archive/2011/11/14/2249021.html
reasons for EXC_BAD_ACCESS:
1、访问受保护或者不存在的内存空间,导致返回了一个错误的指针;
2、访问未进行内存分配或初始化的内存空间;
3、在对象被释放后仍然采用原来的指针进行访问;
4、采用了[object release]释放对象,但其实对象并未采用 alloc/copy/retain 等形式进行内存分配;(这是我此次错误的原因)
I guess my issue is 1st or 2nd ones.
* handle EXC_BAD_ACCESS
# added the following statement:
// prime the queue with some data before starting
for (int i =0; i <kNumberBuffers; ++i) {
AudioQueueAllocateBuffer(mQueue,MAX_BYTES_BUFFER, &mBuffers[i]); // added by frank.zou on 2012/02/21 Q: why no this before ?
AQBufferCallback (this, mQueue, mBuffers[i]);
^ Why not AQBufferPrime(...) ? 2012/03/12
}
still the error EXC_BAD_ACCESS, but it is about memcpy(...) in readAudioDataPackets() now.
// copy all data to audioData buffer
memcpy(audioData, buffer, (size_t)numBytes);
* found out that numBytes is a pointer, changes as follows:
memcpy(audioData, buffer, (size_t)*numBytes);
^ done !
note: still some noise need to be taken care of.
Q: Why SpeakHere samples does not init Audio Queue buffer ?
2. study view related stuff for iOS
Camera Programming Topics for iOS
* something related
Image Picker Controller
AV Foundation framework
Assets Library
- iPhone/iPad开发扎记 2012/02/21
- iPhone/iPad开发扎记 2012/02/05
- iPhone/iPad开发扎记 2012/02/06
- iPhone/iPad开发扎记 2012/02/07
- iPhone/iPad开发扎记 2012/02/09
- iPhone/iPad开发扎记2012/02/17
- iPhone/iPad开发扎记 2012/02/18
- iPhone/iPad开发扎记2012/02/19
- iPhone/iPad开发扎记2012/02/20
- iPhone/iPad开发札记 2012/02/22
- iPhone/iPad开发札记 2012/02/23
- iPhone/iPad开发札记 2012/02/24
- iPhone/iPad开发札记 2012/02/26
- iPhone/iPad开发札记 2012/02/27
- iPhone/iPad开发扎记 2012/02/11 - 玩转iOS Audio Service
- iPhone/iPad开发札记2012/03/05
- iPhone/iPad开发札记2012/03/06
- iPhone/iPad开发札记 2012/03/13
- jQuery.autocomplete 支持中文输入
- 嵌入式Linux网络驱动程序的开发及实现原理
- Js_基本数据类型
- 《c和指针》笔记
- 数据库设计--ER图
- iPhone/iPad开发扎记 2012/02/21
- hibernate generator class="" id详解
- - (void)setNeedsDisplay得作用和用法
- hibernate一级缓存和二级缓存的区别
- Android 一个apk多个ICON执行入口
- c++信号槽的使用方法
- javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building f
- dentry与inode、dentry_cache
- Lucene.Net系列学习(4)