Trouble getting location to recorded audio

by Pich » Sun, 29 Nov 2009 04:21:05 GMT

Sponsored Links

I have to following code to launch and the audio recorder on Android:

final Intent recordSoundIntent = new Intent
String fileName = Environment.getExternalStorageDirectory() +
File.separator + UUID.randomUUID() + ".3gpp";
recordSoundIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new
getString(R.string.record_sound_chooser)), INTENT_SOUND_RECORDING);

And the following code to save the location to the newly recorded

Uri uri = data.getData():

And this code to play (it works with no problem):

MediaPlayer mp = new MediaPlayer();

My problem is the following:

1. My filename (fileName) has no effect, the Uri returned from
data.getData() returns in my last test run: 
However, this file is created on my sdcard: recording34485.3gpp. If it
is not possible to set custom location upon creating sound it is the
location to this file I would like.

2. I want to mail this recording using the ACTION_SEND, but I can't
attach the audio file, I guess because soundRecording.getLocation()
points to content://media/external/audio/media/41 and not
File file = new File(soundRecording.getLocation());
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));

Can anyone help me?

Best regards



Other Threads

1. Fw: Delivery Status Notification (Failure)

Sent from my BlackBerry
powered by Sinyal Kuat INDOSAT

-----Original Message-----
From: Mail Delivery Subsystem <>
Date: Mon, 05 Apr 2010 05:37:28 
To: <>
Subject: Delivery Status Notification (Failure)

Delivery to the following recipient failed permanently:

Technical details of permanent failure: 
The has exceeded the maxium allowed mail rate 
for groups with archiving enabled.

----- Original message -----

Received: by with SMTP id u21mr1218370vcx.28.1270445847973;
        Sun, 04 Apr 2010 22:37:27 -0700 (PDT)
Received: by with SMTP id u21mr1218369vcx.28.1270445847940;
        Sun, 04 Apr 2010 22:37:27 -0700 (PDT)
Return-Path: <>
Received: from ( 
        by with ESMTP id 
        Sun, 04 Apr 2010 22:37:26 -0700 (PDT)
Received-SPF: pass ( domain of designates as permitted sender) client-ip=;
Authentication-Results:; spf=pass ( domain of designates as permitted sender); dkim=pass (test mode)
Received: by qyk29 with SMTP id 29so3980753qyk.2
        for <>; Sun, 04 Apr 2010 22:37:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma;
DomainKey-Signature: a=rsa-sha1; c=nofws;; s=gamma;
Received: by with SMTP id u19mr1861042qal.8.1270445846602;
        Sun, 04 Apr 2010 22:37:26 -0700 (PDT)
Return-Path: <>
Received: from bda073.bisx.prodap.on.blackberry 
( [])
        by with ESMTPS id 4sm23955861qwe.32.2010.
        (version=SSLv3 cipher=RC4-MD5);
        Sun, 04 Apr 2010 22:37:25 -0700 (PDT)
X-rim-org-msg-ref-id: 1311018221
X-Priority: Normal
In-Reply-To: <>
Sensitivity: Normal
Importance: Normal
Subject: Re: [id-android] WTA apa sieh bro asik nya hp android di banding kan 
Date: Mon, 5 Apr 2010 05:36:41 +0000
Content-Type: multipart/alternative; 
MIME-Version: 1.0

Iya bro gw bisa blg gt gr2 ym gw sering bngt putus
Sent from my BlackBerry
powered by Sinyal Kuat INDOSAT

-----Original Message-----
From: Bayu Wicaksono <>
Date: Mon, 5 Apr 2010 12:35:41 
To: <>
Subject: Re: [id-android] WTA apa sieh bro asik nya hp android di banding kan 

Multitask ga sebagus BB? really? gw malah mikir klo Multitask di Android
cuma kalah sama Palm Pre O_O

"Indonesian Android Community [id-android]" 

Join:  http://www.***.com/ 
ID Android Developer:  http://www.***.com/ 
ID Android Surabaya:  http://www.***.com/ 
ID Android on FB:  http://www.***.com/ 

To unsubscribe, reply using "remove me" as the subject.

2. Applying animation to all the items in the list at once


I have a list view, wherein I need to apply an animation of sliding
the list items to the left in case of a horizontal fling. Now I need
to apply this animation to all the list items at once.

I tried Google it, and I believe I could use setLayoutAnimation for
each list item. and that animation will be applied when the list item
layout is first created or refreshed. But my problem is I wanted that
animation to be applied only to a particular layout for that list
item, and not the entire list item layout.

Can anyone guide me on how to apply animation to list items.

Thanks in advance...


3. Getting the amount of Audio data buffered in the device

4. How to come back main activity from child activity

5. Pejing om Putra Abbas

6. How to modify NAND device blocks size from 4096 to 2048 at run-time

7. Not able to access the contact birthday events in Android 1.6