41 lines
1.7 KiB
Markdown
41 lines
1.7 KiB
Markdown
# DDFFmpegKit_Private
|
|
|
|
[](https://travis-ci.org/DDIsFriend/DDFFmpegKit_Private)
|
|
[](https://cocoapods.org/pods/DDFFmpegKit_Private)
|
|
[](https://cocoapods.org/pods/DDFFmpegKit_Private)
|
|
[](https://cocoapods.org/pods/DDFFmpegKit_Private)
|
|
|
|
## Example
|
|
|
|
To run the example project, clone the repo, and run `pod install` from the Example directory first.
|
|
|
|
## Use
|
|
```Objective-C
|
|
NSString *fromFile = [[NSBundle mainBundle] pathForResource:@"begin.pcm" ofType:nil];
|
|
NSString *toFile = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject stringByAppendingFormat:@"/begin_transcode.aac"];
|
|
NSError *error = nil;
|
|
NSArray *commands = @[@"ffmpeg",@"-y",@"-f",@"s16be",@"-ac",@"2",@"-ar",@"8000",@"-acodec",@"pcm_s16le",@"-i",fromFile,toFile];
|
|
if ([DDFFmpegManager transcodeWithCommands:commands]) {
|
|
self.audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:toFile] error:&error];
|
|
[self.audioPlayer play];
|
|
}
|
|
```
|
|
## Requirements
|
|
|
|
## Installation
|
|
|
|
DDFFmpegKit_Private is available through [CocoaPods](https://cocoapods.org). To install
|
|
it, simply add the following line to your Podfile:
|
|
|
|
```ruby
|
|
pod 'DDFFmpegKit_Private'
|
|
```
|
|
|
|
## Author
|
|
|
|
DDIsFriend, DDIsFriend@163.com
|
|
|
|
## License
|
|
|
|
DDFFmpegKit_Private is available under the MIT license. See the LICENSE file for more info.
|