Captured audio: missing file extension

79 views
Skip to first unread message

Ivan

unread,
Apr 17, 2017, 6:31:10 PM4/17/17
to CodenameOne Discussions
Hi guys,

with last libs version (159) the media file captured using Capture.captureAudio() on Android has no extension (e.g. mtmp1245577840dat)
Is this intention and should I assess the mime type (and file extension) self somehow in new version or is it bug?
(Until now the extension was part of the temporary file name returned from Capture.captureAudio() and my app relies on this)

thanks

Ivan

IDE: Eclipse
Desktop OS: Ubuntu 16.04
Simulator
Device Xiaomi Redmi Note 3

Shai Almog

unread,
Apr 18, 2017, 1:30:24 AM4/18/17
to CodenameOne Discussions
Hi,
are you sure?
Looking at the history from the past 3 weeks: https://github.com/codenameone/CodenameOne/commits/master
I can't see anything that should impact this. The only thing remotely close is https://github.com/codenameone/CodenameOne/commit/75a54f9ea89470bb4c3e67ac836dd85a9814052a and it's a trivial change.

Ivan Ilavsky

unread,
Apr 18, 2017, 4:02:03 AM4/18/17
to codenameone...@googlegroups.com
May be it's changed for longer time. One of the users discovered it now after last libs update ... the extension is missing and the application is not able to play the audio file on Android using Display.getInstance().execute(path); (this worked for me previously)
How can I fInd out what encoding/mime type is used (AAC, AMR, ..) ?


--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/KffK7T0UUn8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/6d09bf30-4dd1-46d8-8d60-05bfe13be190%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Steve Hannah

unread,
Apr 18, 2017, 7:39:51 PM4/18/17
to codenameone...@googlegroups.com
Capture.captureAudio() uses 3gpp format.  When you copy the file to file system storage, add the .3gpp extension and then it should work with Display.execute().

I'm experimenting a little with the mimetypes and extensions right now in the android port to see if I can improve things for mimetype detection.  I will likely be changing the temp file produced by captureAudio() to use the .3gpp extension anyways.  

Notice that you shouldn't pass the path that you get back from captureAudio() directly to Display.execute().  You should first copy it to file system storage, then pass the copy to execute().

Steve

On Tue, Apr 18, 2017 at 1:01 AM, Ivan Ilavsky <ivan.i...@tamebytes.sk> wrote:
May be it's changed for longer time. One of the users discovered it now after last libs update ... the extension is missing and the application is not able to play the audio file on Android using Display.getInstance().execute(path); (this worked for me previously)
How can I fInd out what encoding/mime type is used (AAC, AMR, ..) ?

On Tue, Apr 18, 2017 at 7:30 AM, Shai Almog <shai....@gmail.com> wrote:
Hi,
are you sure?
Looking at the history from the past 3 weeks: https://github.com/codenameone/CodenameOne/commits/master
I can't see anything that should impact this. The only thing remotely close is https://github.com/codenameone/CodenameOne/commit/75a54f9ea89470bb4c3e67ac836dd85a9814052a and it's a trivial change.

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/KffK7T0UUn8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsubscr...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Software Developer
Codename One

Ivan Ilavsky

unread,
Apr 19, 2017, 5:51:10 AM4/19/17
to codenameone...@googlegroups.com
yes, with extension .3gpp it works for me again, thanks

To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.



--
Steve Hannah
Software Developer
Codename One

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/KffK7T0UUn8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

shop.servic...@gmail.com

unread,
Aug 15, 2017, 9:57:32 AM8/15/17
to CodenameOne Discussions, ivan.i...@tamebytes.sk
I am saving audio files to a DB table on a server in a common format .wav using ffmpeg to do the conversion.
However on Android, I get Error message using Display.execute(). on a .wav file.

Is this what I should expect and enforce the file format be saved in .3gpp?

Regards

On Wednesday, April 19, 2017 at 5:51:10 AM UTC-4, Ivan wrote:
yes, with extension .3gpp it works for me again, thanks
On Wed, Apr 19, 2017 at 1:39 AM, Steve Hannah <steve....@codenameone.com> wrote:
Capture.captureAudio() uses 3gpp format.  When you copy the file to file system storage, add the .3gpp extension and then it should work with Display.execute().

I'm experimenting a little with the mimetypes and extensions right now in the android port to see if I can improve things for mimetype detection.  I will likely be changing the temp file produced by captureAudio() to use the .3gpp extension anyways.  

Notice that you shouldn't pass the path that you get back from captureAudio() directly to Display.execute().  You should first copy it to file system storage, then pass the copy to execute().

Steve
On Tue, Apr 18, 2017 at 1:01 AM, Ivan Ilavsky <ivan.i...@tamebytes.sk> wrote:
May be it's changed for longer time. One of the users discovered it now after last libs update ... the extension is missing and the application is not able to play the audio file on Android using Display.getInstance().execute(path); (this worked for me previously)
How can I fInd out what encoding/mime type is used (AAC, AMR, ..) ?

On Tue, Apr 18, 2017 at 7:30 AM, Shai Almog <shai....@gmail.com> wrote:
Hi,
are you sure?
Looking at the history from the past 3 weeks: https://github.com/codenameone/CodenameOne/commits/master
I can't see anything that should impact this. The only thing remotely close is https://github.com/codenameone/CodenameOne/commit/75a54f9ea89470bb4c3e67ac836dd85a9814052a and it's a trivial change.

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/KffK7T0UUn8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.



--
Steve Hannah
Software Developer
Codename One

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/KffK7T0UUn8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKXhb35vAOMJZBhtd69YfCjfRdhBS1GCaNxEOmThe-kz9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

shop.servic...@gmail.com

unread,
Aug 15, 2017, 12:45:34 PM8/15/17
to CodenameOne Discussions, ivan.i...@tamebytes.sk, shop.servic...@gmail.com
Further investigations reveal that Ican manually copy a .wav file to my downloads dir on the Samsung8S+, open file manager, tap the file and The Phone opens the file with Google Play. (Audio is correct)

Is there an option for Display.execute() to use Google Play?

Thoughts?

Shai Almog

unread,
Aug 16, 2017, 1:07:08 AM8/16/17
to CodenameOne Discussions, ivan.i...@tamebytes.sk, shop.servic...@gmail.com
Opening media should generally invoke the right intent did you use an MP3 extension?

shop.servic...@gmail.com

unread,
Aug 16, 2017, 9:17:23 AM8/16/17
to CodenameOne Discussions, ivan.i...@tamebytes.sk, shop.servic...@gmail.com
I download a .wav file from my server and pass that to Display.getInstance().execute(AudioFile.wav)

AndroidAudioDotWavWontPlay_2.jpg shows the full path file being passed to Display.getInstance().execute(AudioFile.wav)
AndroidAudioDotWavWontPlay_1.jpg shows the OS Complaint after Display.getInstance().execute(AudioFile.wav) is executed

Note the OS complains of invalid format, however this same file plays on my PC and IOS using the same method of download and play.

Thoughts?


On Wednesday, August 16, 2017 at 1:07:08 AM UTC-4, Shai Almog wrote:
AndroidAudioDotWavWontPlay_1.jpg
AndroidAudioDotWavWontPlay_2.jpg

shop.servic...@gmail.com

unread,
Aug 16, 2017, 3:23:52 PM8/16/17
to CodenameOne Discussions, ivan.i...@tamebytes.sk, shop.servic...@gmail.com
Just to prove out the integrity of the .wav file downloaded,
I processed the Audio File with this code and it plays perfectly

                    media = MediaManager.createMedia(AudioFile, false);
                    media.play();

Of course I would prefer the native player as it provides controls that the above does not. (I understand the above have all the methods for me to implement a control friendly player)

shop.servic...@gmail.com

unread,
Aug 16, 2017, 7:29:10 PM8/16/17
to CodenameOne Discussions, ivan.i...@tamebytes.sk, shop.servic...@gmail.com
Just noticed mp4 videos are producing the same PDF complaints on Android.
See attached
Item5b.png

Shai Almog

unread,
Aug 17, 2017, 12:36:30 AM8/17/17
to CodenameOne Discussions, ivan.i...@tamebytes.sk, shop.servic...@gmail.com
If MP4 files have that issue then please file an issue and we'll check that.

shop.servic...@gmail.com

unread,
Aug 17, 2017, 8:50:01 AM8/17/17
to CodenameOne Discussions, ivan.i...@tamebytes.sk, shop.servic...@gmail.com
Please refresh me, how do I report this?

Shai Almog

unread,
Aug 18, 2017, 12:55:13 AM8/18/17
to CodenameOne Discussions, ivan.i...@tamebytes.sk, shop.servic...@gmail.com
Reply all
Reply to author
Forward
0 new messages