You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
853 B
36 lines
853 B
1 year ago
|
//
|
||
|
// VoiceConverter.m
|
||
|
// Jeans
|
||
|
//
|
||
|
// Created by Jeans Huang on 12-7-22.
|
||
|
// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "VoiceConverter.h"
|
||
|
#import "wav.h"
|
||
|
#import "interf_dec.h"
|
||
|
#import "dec_if.h"
|
||
|
#import "interf_enc.h"
|
||
|
#import "amrFileCodec.h"
|
||
|
|
||
|
@implementation VoiceConverter
|
||
|
|
||
|
+ (int)amrToWav:(NSString*)_amrPath wavSavePath:(NSString*)_savePath{
|
||
|
|
||
|
if (! DecodeAMRFileToWAVEFile([_amrPath cStringUsingEncoding:NSASCIIStringEncoding], [_savePath cStringUsingEncoding:NSASCIIStringEncoding]))
|
||
|
return 0;
|
||
|
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
+ (int)wavToAmr:(NSString*)_wavPath amrSavePath:(NSString*)_savePath{
|
||
|
|
||
|
if (EncodeWAVEFileToAMRFile([_wavPath cStringUsingEncoding:NSASCIIStringEncoding], [_savePath cStringUsingEncoding:NSASCIIStringEncoding], 1, 16))
|
||
|
return 0;
|
||
|
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
|
||
|
@end
|