Please explain media.save

I’ve searched the forums and docs, but a few things about media.save are still unclear to me.

i’m doing this:

media.save(“image” … imageFileIndex …".jpg", system.DocumentsDirectory)

when I launch the project in my simulator, images are saved on desktop by default. How can I change the path to a different folder?

Plus, when this is deployed on device, where would the images be saved then?

does media.save work for only images? What equivalent command is there to save audio files?

Thanks. [import]uid: 175611 topic_id: 33657 reply_id: 333657[/import]

Hello,
I can try to answer a few of your questions…

  1. Do you wish to save the files on your local (computer) to some other place than Desktop? I don’t believe this is possible. What is your reason for wanting to accomplish this?

  2. On the device itself, those images will be saved to the “system.DocumentsDirectory” as stated in the function. Please view the following page under “See also” to explore the different directories on a device. Some of these you can’t add or manipulate files within, for obvious security reasons.
    http://docs.coronalabs.com/api/library/system/pathForFile.html

  3. Yes, media.save only works for images. When you ask about “command to save audio files”, what exactly are you attempting? Which audio files? Are you trying to make an audio recording using the microphone and save it?

I hope this helps somewhat. Please specify in more detail on the issues above and I can try to locate better answers for you.

Thanks,
Brent [import]uid: 200026 topic_id: 33657 reply_id: 133883[/import]

Thanks for the response Brent. However, I have now managed to succeed in saving the sound files.

  1. I was exploring different options, wanted to experiment with saving the images somewhere else in the computer.

  2. Thanks, that point is pretty clear now.

  3. Yes, I tried to make an audio recording and save the files, but was having problems. Now, my code is working, I guess the problem was at my end. But I still wonder, is there no command like display.save, display.capture or media.save for audio files?

Thanks [import]uid: 175611 topic_id: 33657 reply_id: 133972[/import]

Hello,
I can try to answer a few of your questions…

  1. Do you wish to save the files on your local (computer) to some other place than Desktop? I don’t believe this is possible. What is your reason for wanting to accomplish this?

  2. On the device itself, those images will be saved to the “system.DocumentsDirectory” as stated in the function. Please view the following page under “See also” to explore the different directories on a device. Some of these you can’t add or manipulate files within, for obvious security reasons.
    http://docs.coronalabs.com/api/library/system/pathForFile.html

  3. Yes, media.save only works for images. When you ask about “command to save audio files”, what exactly are you attempting? Which audio files? Are you trying to make an audio recording using the microphone and save it?

I hope this helps somewhat. Please specify in more detail on the issues above and I can try to locate better answers for you.

Thanks,
Brent [import]uid: 200026 topic_id: 33657 reply_id: 133883[/import]

Thanks for the response Brent. However, I have now managed to succeed in saving the sound files.

  1. I was exploring different options, wanted to experiment with saving the images somewhere else in the computer.

  2. Thanks, that point is pretty clear now.

  3. Yes, I tried to make an audio recording and save the files, but was having problems. Now, my code is working, I guess the problem was at my end. But I still wonder, is there no command like display.save, display.capture or media.save for audio files?

Thanks [import]uid: 175611 topic_id: 33657 reply_id: 133972[/import]