ios 音频视频(2016-02-29 17:59) 一直未发布。。。。。 现在更新下自己的记录
1.音频 avaudio queue AudioQueueNewInput http://blog.csdn.net/nothingl3/article/details/42265621 http://www.cnblogs.com/sunminmin/p/4519039.html
2.
//1.创建视频设备(摄像头前,后)
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
//2.初始化一个摄像头输入设备(first是后置摄像头,last是前置摄像头)
AVCaptureDeviceInput *inputVideo = [AVCaptureDeviceInput deviceInputWithDevice:[devices firstObject] error:NULL];
//3.创建麦克风设备
AVCaptureDevice *deviceAudio = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio];
//4.初始化麦克风输入设备
AVCaptureDeviceInput *inputAudio = [AVCaptureDeviceInput deviceInputWithDevice:deviceAudio error:NULL];
- AVCaptureDevice *device = [AVCaptureDevice
- defaultDeviceWithMediaType:AVMediaTypeVideo];//这里默认是使用后置摄像头,你可以改成前置摄像头
- // Create a device input with the device and add it to the session.
- AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device
- error:&error];
- AVCaptureDevice *device = [AVCaptureDevice
- defaultDeviceWithMediaType:AVMediaTypeAudio
];//这里默认是使用后置摄像头,你可以改成前置摄像头 - // Create a device input with the device and add it to the session.
- AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device
- error:&error];