How to merge audio files in one on top of each other android -
sup! trying merge list of audio files on top of each other 1 audio file. followed answer on this question, doesn't work. tried this(the code below) doesn't work either(probably because javax not compatible android)
even if know how usage of other libraries android, please, show it. thing ask should done locally, without using servers.
thank you!
public class joinwavs{ public static void main(string[] args) { string wavfile1 = "d:\\wav1.wav"; string wavfile2 = "d:\\wav2.wav"; try { audioinputstream clip1 = audiosystem.getaudioinputstream(new file(wavfile1)); audioinputstream clip2 = audiosystem.getaudioinputstream(new file(wavfile2)); audioinputstream appendedfiles = new audioinputstream( new sequenceinputstream(clip1, clip2), clip1.getformat(), clip1.getframelength() + clip2.getframelength()); audiosystem.write(appendedfiles, audiofileformat.type.wave, new file("d:\\wavappended.wav")); } catch (exception e) { e.printstacktrace(); } } }
Comments
Post a Comment