Titanium Saving the Recorded Audio Files in a folder, Uploading audio files to Web Server, - iphone

How to save the file which is recorded in sound_record.js File from Appcellrator Titanium KitchenSick Demo.
file = recording.stop(); // file container TiFile Object
sound = Titanium.Media.createSound({sound:file}); // Sound Contains. TiMedia Object
I found these two lines which has the data, which is recorded, But i didnt get that, How to save these recorded data into iphone, so that they can have an access to these files which is recorded.
And also Uploading the Audio files to Web Server, Every where we have how to upload the Image which comes from Gallery, But there is no where its mentioned how we can upload the audio files such as .wav file which is recorded using sound_record.js.

I would checkout the KitchenSink, you'll find a lot of examples there. For saving I would checkout the filesystem.js and for upload the xhr_fileupload.js.

Related

How to load all audio files from phone's storage in flutter

I want to get all the audio files to my flutter app and play them.
As you can see all the audio files are already scanned and can be found in audio directory in phones. How do I get that directly without going anywhere.
Is there a way to get it from there.
I have tried to walk in all the folders but I thought it is not the good way.

AVPlayer, Play a local file URL that is currently being written to?

I have been trying to use a custom AVPlayerItem that lets me copy the currently playing media to file after it has been downloaded while it is streaming into the AVPlayer, essentially letting me cache the displayed video while showing the video as soon as possible.
Unfortunately, my application sometimes needs to download mp4 files from a server (that I don't control) that is giving the mime type as image/gif although the downloaded file IS an mp4 file. Because of this, my AVPlayer is not "streaming" in the video as it's downloaded, and only shows it once the file is completely downloaded and it realizes the file really is an MP4.
My thought is now to just download the file directly to a local file with a .mp4 extension that a standard AVPlayerItem can stream in, and write to this file while reading from it with the AVPlayerItem. Is this possible? Will the AVPlayerItem pause when it is still downloading/buffering the incomplete data or will it just produce an error without displaying anything? Is there a better way I can be doing this?

Merging audio files ( .caf ) using xcode

I want to merge two recorded audio files (.caf)in an iphone .is there any solution?for recording am using avaudioplayer.
answered By: MidHere
You can do it using ExtAudioFileService. In ios developer library they had provided two examples to convert one audio file to another format. In these they are opening one audio file for reading and another file for writing (converted audio). You can change or updated code to read from two files and write them to one out put file in same format(caf) or compressed format. First you have open first audio file and read every packets from it and write it to a new audio file. After finishing first audio file, close the file and open second audio file for reading. Now read every packets from second audio file and write to newly created audio file and close second audio file and new audio file.
Please find the links(1,2) for these sample codes .... Hope this helps you...and good luck. :)

combine two .caf audio files into a single audio file in iphone

I am using AVAudioRecorder for recording audio in .caf format. When the user will resume this recording the new recording must append with the old recording. So how can i combine two .caf audio files.
You can do it using ExtAudioFileService. In ios developer library they had provided two examples to convert one audio file to another format. In these they are opening one audio file for reading and another file for writing (converted audio). You can change or updated code to read from two files and write them to one out put file in same format(caf) or compressed format. First you have open first audio file and read every packets from it and write it to a new audio file. After finishing first audio file, close the file and open second audio file for reading. Now read every packets from second audio file and write to newly created audio file and close second audio file and new audio file.
Please find the links(1,2) for these sample codes ....
Hope this helps you...and good luck. :)

Where are downloaded sound files saved?

When I download a sound file in my iPhone, in which directory is it stored?
There is no 'sound file directory'.
Safari cannot download files to the iPhone and if you download a sound file from code you will receive the data in an NSData object. From there it is up to you where you write the file (or even if you write a file, you could use the data without saving it). However you will still not have many options on where to save the file because of the iPhone sandbox.