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

1.7 KiB

DDFFmpegKit_Private

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Use

    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. To install it, simply add the following line to your Podfile:

pod 'DDFFmpegKit_Private'

Author

DDIsFriend, DDIsFriend@163.com

License

DDFFmpegKit_Private is available under the MIT license. See the LICENSE file for more info.