i have trouble in app.
i want record sound , store in ios using cordova. have base64/wav file, it's heavy want convert base64/mp3.
which algorithm allows me that?
example:
b64wavtob64mp3("base64/..."); // return mp3 base64 thanks in advance!
i forgot base64 because looking audio compressed
solved!
i did wav2m4a plugin.
but wanted go further modified cdvsound.m @ ios. followed these instructions:
add
startrecordingaudiomethod oncdvsound.mthis:nsdictionary *recordsettings = [nsdictionary dictionarywithobjectsandkeys: [nsnumber numberwithint: kaudioformatmpeg4aac], avformatidkey, [nsnumber numberwithfloat:16000.0], avsampleratekey, [nsnumber numberwithint: 1], avnumberofchannelskey, nil];
replace:
audiofile.recorder = [[cdvaudiorecorder alloc] initwithurl:audiofile.resourceurl settings:nil error:&error]; // default pcm recording
with:
audiofile.recorder = [[cdvaudiorecorder alloc] initwithurl:audiofile.resourceurl settings:recordsettings error:&error];
- changing lines: cdvsound.m checks make sure you're using wav file. changing @ top of file should prevent that.
define recording_wav @"wav"
i changed to:
#define recording_wav @"m4a" or
#define recording_m4a @"m4a" and change in file instances contains recording_wav variable.
Comments
Post a Comment