Trouble getting location to recorded audio

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


Sponsored Links
 Hi,

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

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


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

Uri uri = data.getData():
soundRecording.setLocation(uri.toString());

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

MediaPlayer mp = new MediaPlayer();
mp.setDataSource(soundRecording.getLocation());
mp.prepare();
mp.start();


My problem is the following:

1. My filename (fileName) has no effect, the Uri returned from
data.getData() returns in my last test run: 
content://media/external/audio/media/41.
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
recording34485.3gpp:
File file = new File(soundRecording.getLocation());
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));

Can anyone help me?

Best regards

Pich

--



Other Threads

1. Fw: Delivery Status Notification (Failure)

Sent from my BlackBerry
powered by Sinyal Kuat INDOSAT

-----Original Message-----
From: Mail Delivery Subsystem <mailer-dae...@google.com>
Date: Mon, 05 Apr 2010 05:37:28 
To: <alucardbo...@gmail.com>
Subject: Delivery Status Notification (Failure)

Delivery to the following recipient failed permanently:

     id-android@googlegroups.com

Technical details of permanent failure: 
The groupid-andr...@googlegroups.com has exceeded the maxium allowed mail rate 
for groups with archiving enabled.

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

Received: by 10.220.162.85 with SMTP id u21mr1218370vcx.28.1270445847973;
        Sun, 04 Apr 2010 22:37:27 -0700 (PDT)
Received: by 10.220.162.85 with SMTP id u21mr1218369vcx.28.1270445847940;
        Sun, 04 Apr 2010 22:37:27 -0700 (PDT)
Return-Path: <alucardbo...@gmail.com>
Received: from mail-qy0-f191.google.com (mail-qy0-f191.google.com 
[209.85.221.191])
        by gmr-mx.google.com with ESMTP id 
34si29341332vws.3.2010.04.04.22.37.26;
        Sun, 04 Apr 2010 22:37:26 -0700 (PDT)
Received-SPF: pass (google.com: domain of alucardbo...@gmail.com designates 
209.85.221.191 as permitted sender) client-ip=209.85.221.191;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of 
alucardbo...@gmail.com designates 209.85.221.191 as permitted sender) 
smtp.mail=alucardbo...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by qyk29 with SMTP id 29so3980753qyk.2
        for <id-android@googlegroups.com>; Sun, 04 Apr 2010 22:37:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:x-rim-org-msg-ref-id
         :message-id:reply-to:x-priority:references:in-reply-to:sensitivity
         :importance:subject:to:from:date:content-type:mime-version;
        bh=4Dv64BT+Sft46ZUFqOt9aCCNr9BUkzJ7d9c7IzVd8uw=;
        b=VZjG4V+jVOwxRMr6yzpmgffHaWpOhdT2RMSS7T02vfdAShWdCpYxtxDmNwGu283ZEh
         luB1lSDGtO/lSmghi3EUxU0sGkF0f/v6C4DwFQ6FdHJOg9I2WPRZcNyzjAHY2ntROFZf
         0jBAnHkKQyOuAQC/pqO3Mati5xVFAaYfp/3bo=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=x-rim-org-msg-ref-id:message-id:reply-to:x-priority:references
         :in-reply-to:sensitivity:importance:subject:to:from:date
         :content-type:mime-version;
        b=e+GlbdvpvkUmXqIJQ6HMG/T/0Es/fBE+F2aWCczEzaBlLSPFf3B05InCfgQeE895gZ
         OhbSJ86iA9tpfITTVdVXm981Vb1jBwP86z2SB8g2MHRiYTN7mU1DmIVOcb7Qw0K8vzNg
         KGGXq4pW7jE24VDulBZOND0SemSmMKePo8lLY=
Received: by 10.224.87.19 with SMTP id u19mr1861042qal.8.1270445846602;
        Sun, 04 Apr 2010 22:37:26 -0700 (PDT)
Return-Path: <alucardbo...@gmail.com>
Received: from bda073.bisx.prodap.on.blackberry 
(bda-206-53-150-131.bise.na.blackberry.com [206.53.150.131])
        by mx.google.com with ESMTPS id 4sm23955861qwe.32.2010.04.04.22.37.25
        (version=SSLv3 cipher=RC4-MD5);
        Sun, 04 Apr 2010 22:37:25 -0700 (PDT)
X-rim-org-msg-ref-id: 1311018221
Message-ID: 
<1311018221-1270445843-cardhu_decombobulator_blackberry.rim.net-9091905...@bda2076.bisx.prodap.on.blackberry>
Reply-To: alucardbo...@gmail.com
X-Priority: Normal
References: 
<911648867-1270444043-cardhu_decombobulator_blackberry.rim.net-20551515...@bda2076.bisx.prodap.on.blackberry>
 
<885836197-1270444488-cardhu_decombobulator_blackberry.rim.net-9894486...@bda041.bisx.prodap.on.blackberry>
 
<967246423-1270444743-cardhu_decombobulator_blackberry.rim.net-17678063...@bda2076.bisx.prodap.on.blackberry><l2k27f220fc1004042235nbb5ef0aek127a9be6ea568...@mail.gmail.com>
In-Reply-To: <l2k27f220fc1004042235nbb5ef0aek127a9be6ea568...@mail.gmail.com>
Sensitivity: Normal
Importance: Normal
Subject: Re: [id-android] WTA apa sieh bro asik nya hp android di banding kan 
iphone/blackberry??
To: id-android@googlegroups.com
From: alucardbo...@gmail.com
Date: Mon, 5 Apr 2010 05:36:41 +0000
Content-Type: multipart/alternative; 
boundary="part2655-boundary-1403893072-1612848788"
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 <bwicaksono.priv...@gmail.com>
Date: Mon, 5 Apr 2010 12:35:41 
To: <id-android@googlegroups.com>
Subject: Re: [id-android] WTA apa sieh bro asik nya hp android di banding kan 
        iphone/blackberry??

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/ 
Moderator: id.andr...@gmail.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

Hello,

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