Is it possible to save audio once recorded?
I see how to start recording via the microphone and how to do playback, but what about saving the audio? Can I use the filesystem api for that? Or is there a way to save to iTunes?
2 Answers
-
This took me a while to figure out (sans documentation). Just change the example code for recording to this:
file = recording.stop(); var f = Ti.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'recording.wav'); if (f.exists()) {f.deleteFile();} f.write(file.toBlob);
That will save the recording to your "Documents" directory.
-
Great toBlob worked for me. Why is this always called a "file" when used in examples? it's not the same as a File object, there no exists() or read() method. Confusing!
Thanks again.