- 博客(60)
- 资源 (3)
- 收藏
- 关注
原创 iOS关于音频文件格式的转换
最近在研究音频文件的转换,涉及到的音频格式pcm,opus,mp3,wav, 音频文件和视频文件的合成,做一下记录。目前苹果系统不支持opus的格式,一般都是opus转pcm,pcm增加wav头后转成wav格式的音频进行播放;参考了很多大神的git代码,贴到这里供大家参考:git@github.com:liuhuakun/OpusDemo.gitgit@github.com:JonorZhang/OpusDemo.gitgit@github.com:zhonglaoban/Audio
2021-10-06 16:40:16
2163
原创 android studio 生成so文件
主要是参考下面的blog:使用AS生成.so文件以及调用(mac环境)_天空windy的博客-优快云博客哪些应用比较适合使用NDK开发?在平台之间移植其应用重复使用现有库或者提供自己的库供重复使用在某些情况下提高性能,特别是像游戏这种计算密集型应用。其中第二条就是因为可以将代码生成.so文件,放在其他项目中使用。一、使用Android Studio生成.so文件的步骤:1、首先电脑中要安装并配置NDK环境。下载ndk并解压 https://developer.androi...https.
2021-10-06 16:13:56
756
原创 圆角设置后UI显示不出来的问题
2021.5.9 遇到的开发问题--圆角设置后UI显示不出来的问题发现采用iOS自动布局框架-Masonry后,单独设置某个View的圆角后,某个view整个都看不到了,但是在xcode里面查图层的方式查View还是存在的,参数也没有任何异常;做了好多的测试,发现不使用masonry之后,单个圆角的设置就可以了,这个坑隐藏的比较深,作为记录;单个或者多个圆角设备代码如下:UIBezierPath* rounded = [UIBezierPath bezierPathWithRoundedRe
2021-05-10 09:06:06
906
原创 pod 安装到指定的版本的步骤
1,查询原来安装的列表命令:bogon:~xxxxx$ gem list*** LOCAL GEMS ***activesupport (4.2.10)atomos (0.1.3)bigdecimal (default: 1.2.8)CFPropertyList (3.0.0, 2.2.8)claide (1.0.2)cocoapods (1.7.3)...
2020-01-03 10:12:17
3129
原创 iOS Lottie 动画应用
准备工作:需要一个动画的json的文件,或者json字符串,一般由UI设计人员生成的,直接导入到project里面就可以;1 在Podfile里面引入第三方库lottie-ios,版本2.5.3是objective-c的版本也可以引入最新的版本是swift的版本:pod 'lottie-ios', :git => 'https://github.com/airbnb/lott...
2019-11-04 18:38:01
1276
原创 ios 获取系统音量以及监听系统音量的设置
获取设备的音量:AVAudioSession *audioSession = [AVAudioSession sharedInstance];CGFloat _systemVoluemValue = audioSession.outputVolume;增加和删除监听设备音量的代码添加设备音量的监听 [[NSNotificationCenter defaultC...
2019-10-30 10:37:32
1965
原创 git 仓库fork 操作总结
1 首先选择一个需要fork的仓库2 进行fork操作3 将fork后的地址clone到本地4 打开终端,cd到clone本地的根目录下5 添加upstream 命令:git remote add upstream 【git地址】6 查询upstream的分支是否加入成功 :git remote -v随后会显示查询后的结果7 更新某个分支:git pull up...
2019-10-24 19:50:13
2336
转载 iOS 声音采集数据放大
https://stackoverflow.com/questions/11573796/audio-unit-recording-increased-volume-of-buffershttps://stackoverflow.com/questions/27661574/how-to-increase-the-volume-of-ios-app-playing-generated-pcm-...
2019-08-26 11:47:27
604
转载 shell 脚本文件
https://blog.youkuaiyun.com/qq_18297675/article/details/52693464编写shell脚本的时候,最前面要加上一行:#!/bin/bash,因为linux里面不仅仅只有bash一个解析器,还有其它的,它们之间的语法会有一些不同,所以最好加上这一句话,告诉系统要用这个解析器。一.shell变量shell变量和一些编程语言不同,一般shell的变...
2019-08-02 16:21:36
559
原创 ios13 CNCopyCurrentNetworkInfo 不管用
根据wwdc的要求CNCopyCurrentNetworkInfo这个接口符合以下三个条件才能获取当前的Wi-Fi名字:Apps with permission to access location Your app is the currently enabled VPN app Your app configured the WiFi network the device ...
2019-07-16 14:49:13
3041
1
转载 self.view.frame配置问题
转载:http://blog.sina.com.cn/s/blog_1410870560102wu9a.html在iOS 7中,苹果引入了一个新的属性,叫做[UIViewController setEdgesForExtendedLayout:],它的默认值为UIRectEdgeAll。当你的容器是navigation controller时,默认的布局将从navigation b...
2019-06-25 11:20:36
917
原创 GitHub ssh key的配置
目前多个项目的需求,需要一台mac本支持多个git的服务器,因此需要生成多个ssh的key,配置。1 ssh-keygen -t rsa -C "email@mail.com"2 Enter file in which to save the key (/Users/用户/.ssh/id_rsa):添加需要存储地方的名字如果之前没有存储key键值的信息则可以直接填写:Users/用户/...
2018-08-26 20:03:44
276
原创 android studio的安装
1.下载安卓sdkhttp://www.oracle.com2.下载android studiohttp://developer.android.com/intl/zh-cn/sdk/index.html3.安装安卓sdk4.配置安卓的开发环境参考:https://blog.youkuaiyun.com/vvv_110/article/details/728971425.安卓and...
2018-07-21 07:13:02
373
原创 pod 使用的总结
最新在更新升级pod,总结一下最新实用的命令,备份后续使用:pod --version 查询当前的pod的版本pod install 安装pod库pod update 更新pod库$ gem source -l 查询pod的下载源*** CURRENT SOURCES ***https://gems.ruby-china.org/$ gem list 查询pod相关内容*** LOCAL GEMS...
2018-04-17 11:08:28
571
原创 IOS相册视频写入到沙盒并分享
最近在做IOS的系统分享,遇到了存储到相册里面的视频文件无法通过系统分享,分享到邮箱的问题,为了解决这个问题,就需要把系统相册中的视频写入到沙盒里面,通过沙盒的url进行分享处理。搜索的stackoverflow的网站,期间参考了很多人的代码,目前做如下知识的总结,希望对其他人也有帮助:1 寻找相册以及相册中的文件 if(NSClassFromString(@"PHPhotoLibrary")...
2018-03-14 18:43:51
6534
1
原创 IOS 分享相册里面的视频文件
查了很多资料才知道目前的IOS版本不支持相册里面视频文件的分享,需要将视频文件转存到沙盒里面,通过沙盒的url进行分享,以下分享转换的代码,留存处理。将PHAsset格式的文件转存到沙盒里面,并返回分享的url。-(void)getPHAssetUrl:(void(^)(NSURL* url))UrlBlk{ PHFetchResult* fetchResult =
2018-01-17 09:55:19
2570
转载 统计平台
常见的统计平台友盟 网址talkingdata 网址Flurry 网址google analytics 网址统计功能从强到弱依次为:google analytics > Flurry > 友盟 > talkingdata数据响应速度及时性从快到慢为:友盟,talkingdata > Flurry > google analytics前面俩个是国内分析平
2017-11-14 15:25:41
360
转载 pod install 步骤
$ curl -L get.rvm.io | bash -s stable$ source ~/.bashrc$ source ~/.bash_profile$ rvm -v$ rvm list$ ruby -v$ rvm install 2.2.2$ rvm use 2.2.2 --default$ gem sour
2017-06-22 10:48:22
1821
转载 instrument 名词解释
"Live Bytes" means "memory which has been allocated, but not yet deallocated." It's important because it's the most easily graspable measure of "how much memory your app is using.""Overall
2017-06-05 16:30:14
538
转载 H.264->mov文件
AVAssetWriterInput H.264 Passthrough to QuickTime (.mov) - Passing in SPS/PPS to create avcc atom?I have a stream of H.264/AVC NALs consisting of types 1 (P frame), 5 (I frame), 7 (SPS), and
2016-11-21 14:17:58
1629
转载 iOS H.264编辑
iOS does not provide any public access directly to the hardware decode engine, because hardware is always used to decode H.264 video on iOS.Therefore, session 513 gives you all the information y
2016-11-21 13:50:02
317
转载 CVImageBufferRef -> UIImage
If you simply need to convert a CVImageBufferRef to UIImage, it seems to be much more difficult than it should be. Essentially you need to convert to CIImage, then CGImage, THEN UIImage. I wish I coul
2016-11-21 13:21:50
1474
转载 iOS H.264 硬件解码和编码
IOS H.264硬件解码和编码的介绍:Video Toolbox introduced in WWDC '14 session 513. Concepts:概念NALUs: NALUs are simply a chunk of data of varying length that has a NALU start code header 0x00 00
2016-11-21 11:40:16
2490
转载 IOS 16进制的String串转为十进制数
NSString *rString = [cString substringWithRange:range]; //g range.location = 2; NSString *gString = [cString substringWithRange:range]; //b range.location = 4; NSString *
2016-08-25 14:10:49
736
原创 折线图中如何填充渐变颜色
此方法实在矩形中填充渐变颜色,再将不需要保留的渐变色用背景颜色覆盖。作为记录留存。#import "DrawCell.h"#define VIEW_WIDTH self.frame.size.width#define VIEW_HEIGHT self.frame.size.height#define CELL_WIDTH (sel
2016-08-03 17:01:44
2981
转载 UIDatePicker
UIDatePicker 日期/时间选取器(滚轮)—IOS开发 UIDatePicker 是一个控制器类,封装了 UIPickerView,但是他是UIControl的子类,专门用于接受日期、时间和持续时长的输入。日期选取器的各列会按照指定的风格进行自动配置,这样就让开发者不必关心如何配置表盘这样的底层操作。你也可以对其进行定制,令其使用任何范围的日期。UIDa
2016-07-26 15:03:58
456
转载 apple watch遇到的坑
Make sure, the App on your Watch is not running (as BalestraPatrick described). Launch the app and hold the side button a few seconds to bring up the "Turn off your Watch" dialog. Hold the side button
2016-07-15 15:51:46
1667
转载 Swift与C char*
let commandsToPrint: NSData = ...// Create char array with the required size:var dataToSentToPrinter = [CUnsignedChar](count: commandsToPrint.length, repeatedValue: 0)// Fill with bytes from NSDa
2016-03-24 17:27:15
1881
转载 Swift 中 callback 调用
Swift closures and functions are decidedly not C functions. They exist in a weird halfway state between C++ members and Objective-C blocks, so you'll have to move any callbacks into an Objective-C fil
2016-03-24 15:57:59
2272
转载 Swift中C的Block的调用
init () { let allocator: CFAllocator? = kCFAllocatorDefault // Create FSEventStream and return valid FSEventStreamRef // Alias FSEventStreamCallback - CFunction typealias FSEventStre
2016-03-24 15:41:05
734
转载 Swift 调用C函数
C 函数定义int startTest(char *test1, char* test2);Swift中C 函数的引用var test1 = "test1"var test2 = "test2"var cString1 = test1.cStringUsingEncoding(NSUTF8StringEncoding)!var cString2
2016-03-22 16:10:08
1428
转载 在Swift中如何使用C中的Struct
在bridging-header中 需要定义 在Swift中使用的Struct 文件。Bridging-Header.h#include "user_input.h"user_input.c#include struct Pointer { int x; int y;};Pointer *create_pointer() { Pointe
2016-03-15 21:28:24
1715
转载 cocoapods 安装
gem sources -l //检查当前是否有ruby的网站源*** CURRENT SOURCES *** // 如果返回是这个的话,证明没有课下载的ruby的源, 正常返回应该是:*** CURRENT SOURCES *** https://ruby.taobao.org/// 或者是 *** CURRENT SOURCES *** https://rubyg
2016-03-03 15:50:07
334
转载 Home Screen Quick Actions
2、Home Screen Quick Actions通过主屏幕的应用Icon,我们可以用3D Touch呼出一个菜单,进行快速定位应用功能模块相关功能的开发,。如微信、京东的App,本文也将重点介绍这项开发技术。 微信的快速入口京东的快速入口3、Force PropertiesiOS9为我们提供了一个新的交互参数:力度。我们可以检测
2016-03-03 11:27:23
1251
转载 iOS8Extension之Today插件
原文链接:http://www.jianshu.com/p/ab268a1ae000iOS8Extension之Today插件背景iOS8已经发布了快半年时间了,其中一个重大的更新就是扩展(Extension)。以前的iOS非常封闭,不同的APP之间很难相互通信,虽然保证了使用的安全性,但毕竟限制了很多功能,最明显的就是输入法了。苹果经过
2016-02-19 14:14:24
1582
转载 CIFilter
- (UIImage*)sepia{ CIImage *beginImage = [CIImage imageWithCGImage:[self CGImage]]; CIContext *context = [CIContext contextWithOptions:nil]; CIFilter *filter = [CIFilter filterWithNa
2015-12-11 10:28:09
935
转载 iOS auto
有时候会遇到UILabel中的内容超出长度,显示不完全的问题。有一种解决方法是通过动画字幕来实现,比如:字幕向左或者右滚动字幕来回滚动本文以后者为例来说明吧。这里先介绍UIView的通过Block实现的Animation以及其参数控制,最后是实现滚动字幕的代码。UIView有方便的动画实现方式,SDK4.0以上,提供了三个Block的动画方式:+ (
2015-10-20 14:04:09
535
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人