Record audio to file then email it as attachment - possible?

Hello!

I want to develop an app that can record your voice memo and email it to a specific address, or upload to a server. Is this possible in cororna?

Ideally it would all happen under the hood and all the user would be presented with is a “record” and “send” button.

Please tell me corona can handle this :wink:

Thanks!
Alex [import]uid: 66618 topic_id: 30358 reply_id: 330358[/import]

Recording yes, email yes but need clarification - you want it to send the email without the user filling in an address, etc? Just a send button and no user options? (Just want to make sure I understand correctly what you hope to create.) :slight_smile: [import]uid: 52491 topic_id: 30358 reply_id: 121611[/import]

Wow - what as quick response, peach!

Yes indeed,
Ideally I would have the same button start the recording (first press), then stop&email that recording on the second press.

The user would be emailing these audio recordings to me and would not need to know the destination.

It’s a sort of post production service where the user sends his/her sounds to me and I send them back ( if that makes sense)

Thanks for being so prompt!
Alex [import]uid: 66618 topic_id: 30358 reply_id: 121619[/import]

as far as I know you can’t compress the audio files so you would be sending huge aiff files on iOS. [import]uid: 13632 topic_id: 30358 reply_id: 121622[/import]

Here’s a little bit of code that may help below stringed together from the API docs. May be useful for you :slight_smile:

[lua]local filePath = system.pathForFile( song.mp3, system.DocumentsDirectory )
local options =
{
to = “john.doe@somewhere.com”,
subject = “My High Score”,
body = “I scored over 9000!!! Can you do better?”,
attachment = { baseDir=system.DocumentsDirectory,
filename=“song.mp3”, type=“audio” }, – mp3 only on iOS
}

function recordSong()
r = media.newRecording( filePath)
r:startRecording( )
end

function emailSong()
native.showPopup(“mail”, options)
end[/lua]

[import]uid: 62706 topic_id: 30358 reply_id: 121624[/import]

Hi Crafty,

This looks very promising, can’t wait to try it after work!
Thanks!! [import]uid: 66618 topic_id: 30358 reply_id: 121680[/import]

No worries at all, I’m a bit of a frequent face around here :wink:

Let us know how you get on with Deano’s comment above. [import]uid: 52491 topic_id: 30358 reply_id: 121764[/import]

Recording yes, email yes but need clarification - you want it to send the email without the user filling in an address, etc? Just a send button and no user options? (Just want to make sure I understand correctly what you hope to create.) :slight_smile: [import]uid: 52491 topic_id: 30358 reply_id: 121611[/import]

Wow - what as quick response, peach!

Yes indeed,
Ideally I would have the same button start the recording (first press), then stop&email that recording on the second press.

The user would be emailing these audio recordings to me and would not need to know the destination.

It’s a sort of post production service where the user sends his/her sounds to me and I send them back ( if that makes sense)

Thanks for being so prompt!
Alex [import]uid: 66618 topic_id: 30358 reply_id: 121619[/import]

as far as I know you can’t compress the audio files so you would be sending huge aiff files on iOS. [import]uid: 13632 topic_id: 30358 reply_id: 121622[/import]

Here’s a little bit of code that may help below stringed together from the API docs. May be useful for you :slight_smile:

[lua]local filePath = system.pathForFile( song.mp3, system.DocumentsDirectory )
local options =
{
to = “john.doe@somewhere.com”,
subject = “My High Score”,
body = “I scored over 9000!!! Can you do better?”,
attachment = { baseDir=system.DocumentsDirectory,
filename=“song.mp3”, type=“audio” }, – mp3 only on iOS
}

function recordSong()
r = media.newRecording( filePath)
r:startRecording( )
end

function emailSong()
native.showPopup(“mail”, options)
end[/lua]

[import]uid: 62706 topic_id: 30358 reply_id: 121624[/import]

Hi Crafty,

This looks very promising, can’t wait to try it after work!
Thanks!! [import]uid: 66618 topic_id: 30358 reply_id: 121680[/import]

No worries at all, I’m a bit of a frequent face around here :wink:

Let us know how you get on with Deano’s comment above. [import]uid: 52491 topic_id: 30358 reply_id: 121764[/import]