Files
OrderScheduling/Pods/DDFFmpegKit_Private/README.md
DDIsFriend c853b73127 update
2023-09-07 17:09:41 +08:00

41 lines
1.7 KiB
Markdown

# DDFFmpegKit_Private
[![CI Status](https://img.shields.io/travis/DDIsFriend/DDFFmpegKit_Private.svg?style=flat)](https://travis-ci.org/DDIsFriend/DDFFmpegKit_Private)
[![Version](https://img.shields.io/cocoapods/v/DDFFmpegKit_Private.svg?style=flat)](https://cocoapods.org/pods/DDFFmpegKit_Private)
[![License](https://img.shields.io/cocoapods/l/DDFFmpegKit_Private.svg?style=flat)](https://cocoapods.org/pods/DDFFmpegKit_Private)
[![Platform](https://img.shields.io/cocoapods/p/DDFFmpegKit_Private.svg?style=flat)](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.