[android-developers] Re: Recording Audio in a call

2009-04-27 Thread niko20

I think it would be illegal since you could record someone else
without their knowlege.


On Apr 25, 2:59 pm, John Doe halila...@gmail.com wrote:
 Is it going to be possible somehow? in g2 ? cupcake ? i wonder whether
 it is because of software limitations or hardware limitations...

 On Apr 25, 5:33 am, Mark Murphy mmur...@commonsware.com wrote:

  John Doe wrote:
   Hi guys. I have a question and i am looking for an answer for a very
   long time.

   I am trying to record audio when i call someone and when someone calls
   me.I am using phonestatelisteners and i am able to record audio from
   outside (my voice) when i call someone. however when somebody calls me
   it doesnt record my voice at all .

   I am trying to record my voice. Even if somebody calls me. But it
   works only in one direction :( If i call it records my voice if
   somebody calls it doesnt record my voice. Do you know if this is
   possible ?

  No, it is not possible, as I understand it.

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://twitter.com/commonsguy

  Android App Developer Books:http://commonsware.com/books.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio in a call

2009-04-25 Thread Mark Murphy

John Doe wrote:
 Hi guys. I have a question and i am looking for an answer for a very
 long time.
 
 I am trying to record audio when i call someone and when someone calls
 me.I am using phonestatelisteners and i am able to record audio from
 outside (my voice) when i call someone. however when somebody calls me
 it doesnt record my voice at all .
 
 I am trying to record my voice. Even if somebody calls me. But it
 works only in one direction :( If i call it records my voice if
 somebody calls it doesnt record my voice. Do you know if this is
 possible ?

No, it is not possible, as I understand it.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio in a call

2009-04-25 Thread John Doe

Is it going to be possible somehow? in g2 ? cupcake ? i wonder whether
it is because of software limitations or hardware limitations...

On Apr 25, 5:33 am, Mark Murphy mmur...@commonsware.com wrote:
 John Doe wrote:
  Hi guys. I have a question and i am looking for an answer for a very
  long time.

  I am trying to record audio when i call someone and when someone calls
  me.I am using phonestatelisteners and i am able to record audio from
  outside (my voice) when i call someone. however when somebody calls me
  it doesnt record my voice at all .

  I am trying to record my voice. Even if somebody calls me. But it
  works only in one direction :( If i call it records my voice if
  somebody calls it doesnt record my voice. Do you know if this is
  possible ?

 No, it is not possible, as I understand it.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording audio with 1.5 SDK

2009-04-20 Thread j

Thank you Dave.  Is there any sample code utilizing AudioRecord that I
can refer to?

My goal is to write the audio to a RTP network stream.

On Apr 16, 1:21 pm, Dave Sparks davidspa...@android.com wrote:
 See theAudioRecordclass.

 On Apr 16, 11:33 am, j jac...@gmail.com wrote:

  One known limitation of SDK 1.1 was that audio can be recorded only to
  a File and not to a network stream.  Is this still an issue with 1.5
  SDK?

  Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording audio with 1.5 SDK

2009-04-20 Thread Dave Sparks

I think we're still working on sample code for the SDK.

On Apr 20, 11:05 am, j jac...@gmail.com wrote:
 Thank you Dave.  Is there any sample code utilizing AudioRecord that I
 can refer to?

 My goal is to write the audio to a RTP network stream.

 On Apr 16, 1:21 pm, Dave Sparks davidspa...@android.com wrote:

  See theAudioRecordclass.

  On Apr 16, 11:33 am, j jac...@gmail.com wrote:

   One known limitation of SDK 1.1 was that audio can be recorded only to
   a File and not to a network stream.  Is this still an issue with 1.5
   SDK?

   Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-04-09 Thread bw

Hi, the following code works for me.
I was also getting the Start failed. error at one point. Fixed it by
changing my output file extension from .3gpp  to .audio

-Ben


final String path = /sdcard/recording + System.currentTimeMillis() +
_ + (int)(Math.random() * 1000)+ .audio;



final MediaRecorder mr = new MediaRecorder();
mr.setAudioSource(MediaRecorder.AudioSource.MIC);
mr.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
mr.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);


mr.setOutputFile(path);
mr.prepare();
mr.start();

//stop recording after 10 seconds
Timer t = new Timer();

t.schedule(new TimerTask() {

  public void run() {
//stop recording
mr.stop();
mr.release();
  }
}, 10*1000);




On Mar 5, 7:05 pm, jdl j...@edufone.com wrote:
 Hi Ben,

 Since the tutorial's currently broken, do you mind posting what values
 you put in instead of these broken lines:
 recorder.getMimeContentType()
 MediaStore.Audio.INTERNAL_CONTENT_URI;

 If you got everything working, would you be willing to post your code
 (since the tutorial's not yet updated)?

 Thanks,

 AN

 On Feb 26, 4:40 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

   each application has its own private data directory /
   data/app-private/app-package. I believe your working directory is set
   to this directory by default

  Cool.  So it sounds like I should just be able to use a relative path
  from the current location then.  Unfortunately, I'm getting the
  following exception (with no clues as to why start is failing):

  02-26 14:34:55.132: ERROR/AndroidRuntime(164):
  java.lang.RuntimeException: startfailed.
  02-26 14:34:55.132: ERROR/AndroidRuntime(164):     
  atandroid.media.MediaRecorder.start(Native Method)

  Here's my code:

      final MediaRecorder recorder = new MediaRecorder();
      recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
      recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
      recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
      recorder.setOutputFile(test.3gpp);
      recorder.prepare();
      recorder.start();

  On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:

   You can get the path to external storage (e.g. SD card) with
   Environment.getExternalStorageDirectory(). This is world read/
   writable.

   Alternatively, each application has its own private data directory /
   data/app-private/app-package. I believe your working directory is set
   to this directory by default. This is onboard flash, so it will
   survive the user ejecting an SD card. However, there is a limited
   amount to go around, so you don't want to store monster media files
   there.

   On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

 setOutputFile() expects a path to where you want the file stored.

Yep, figured that much by the method name, but what's a valid path?  I
mean I'm figuring it's UNIX-like, but other than that I'm in the
dark.  Is there a preferred place for apps to store data?  Are there
certain directories that I have permission to write to?  What
directories exist on the device by default?  It'd be nice for the docs
on data storage to mention any of these 
things:http://developer.android.com/guide/topics/data/data-storage.html

 You can take a look at the source to SoundRecorder in the open 
 source tree for some working code

Thanks for the example.  This would be a much better example than the
one in the docs that won't compile and implies content must first be
added to a database:  
http://developer.android.com/guide/topics/media/index.html

On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:

 setOutputFile() expects a path to where you want the file stored.

 You can take a look at the source to SoundRecorder in the open source
 tree for some working code:

http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

 On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

  Hi,
  I'd like to create anaudiorecordinginAndroid.  (Actually, I just
  want access to the mic withoutrecordingit, but it seems that's not
  supported so I'll have to create arecordingand tail the file).
  I'm having a very hard time getting started.  Mostly I'm just hoping
  that someone from Google reads this and will update the 
  documentation
  because the example won't compile - it looks like it's from some
  previous version of the SDK because there's an error in every other
  line.  I made my best guess as to what the usage should be, but I 
  keep
  getting a number of different exceptions.
  One question I had is whether I can just specify an arbitrary path 
  to
  the MediaRecorder to startrecordingor whether I have to create an
  entry in the content database.  The JavaDoc for
  MediaRecorder.setOutputFile isn't clear on what it's 

[android-developers] Re: Recording Audio

2009-04-03 Thread david 1
hi Ben, by using you code, I encountered the problem, “The application
audiorecorder(process com.david.android.audiorecorder) has stopped
unexpectedly. Please try again”.

My audiorecoder class looks like as:

import android.app.Activity;
import android.os.Bundle;
//importing yours
…

public class audiorecorder extends Activity {
//then following your codes
…
}

Below is the Logcat info:

D/AndroidRuntime( 815):  AndroidRuntime START 
D/AndroidRuntime( 815): CheckJNI is ON
D/AndroidRuntime( 815): — registering native functions —
I/jdwp ( 815): received file descriptor 25 from ADB
I/ActivityManager( 56): Starting activity: Intent { flags=0×1000
comp={com.david.android.audiorecorder/com.david.android.audiorecorder.audiorecorder}
}
I/ActivityManager( 56): Start proc com.david.android.audiorecorder for
activity com.david.android.audiorecorder/.audiorecorder: pid=824 uid=10040
gids={}
D/AndroidRuntime( 815): Shutting down VM
D/dalvikvm( 815): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 815): DestroyJavaVM shutting VM down
D/dalvikvm( 815): HeapWorker thread shutting down
D/dalvikvm( 815): HeapWorker thread has shut down
D/jdwp ( 815): JDWP shutting down net…
D/jdwp ( 815): +++ peer disconnected
I/dalvikvm( 815): Debugger has detached; object registry had 1 entries
D/dalvikvm( 815): VM cleaning up
D/dalvikvm( 815): LinearAlloc 0×0 used 594756 of 4194304 (14%)
I/jdwp ( 824): received file descriptor 10 from ADB
D/dalvikvm( 824): newInstance failed: no ()
D/AndroidRuntime( 824): Shutting down VM
W/dalvikvm( 824): threadid=3: thread exiting with uncaught exception
(group=0×4000fe68)
E/AndroidRuntime( 824): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime( 824): java.lang.RuntimeException: Unable to instantiate
activity
ComponentInfo{com.david.android.audiorecorder/com.david.android.audiorecorder.audiorecorder}:
java.lang.InstantiationException:
com.david.android.audiorecorder.audiorecorder
E/AndroidRuntime( 824): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2082)
E/AndroidRuntime( 824): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2172)
E/AndroidRuntime( 824): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
E/AndroidRuntime( 824): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1586)
E/AndroidRuntime( 824): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 824): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 824): at
android.app.ActivityThread.main(ActivityThread.java:3790)
E/AndroidRuntime( 824): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 824): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 824): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
E/AndroidRuntime( 824): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:503)
E/AndroidRuntime( 824): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 824): Caused by: java.lang.InstantiationException:
com.david.android.audiorecorder.audiorecorder
E/AndroidRuntime( 824): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 824): at java.lang.Class.newInstance(Class.java:1458)
E/AndroidRuntime( 824): at
android.app.Instrumentation.newActivity(Instrumentation.java:1097)
E/AndroidRuntime( 824): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
E/AndroidRuntime( 824): … 11 more
I/Process ( 56): Sending signal. PID: 824 SIG: 3
I/dalvikvm( 824): threadid=7: reacting to signal 3
I/dalvikvm( 824): Wrote stack trace to ‘/data/anr/traces.txt’
W/InputManagerService( 56): Starting input on non-focused client
android.view.inputmethod.inputmethodmanage...@43704540 (uid=1000 pid=56)
W/InputManagerService( 56): Ignoring focus gain of:
android.view.inputmethod.inputmethodmanage...@43704540
W/ActivityManager( 56): Launch timeout has expired, giving up wake lock!
W/ActivityManager( 56): Activity idle timeout for HistoryRecord{43852e68
{com.david.android.audiorecorder/com.david.android.audiorecorder.audiorecorder}}
D/dalvikvm( 100): GC freed 1763 objects / 93784 bytes in 135ms
I/Process ( 824): Sending signal. PID: 824 SIG: 9
I/ActivityManager( 56): Process com.david.android.audiorecorder (pid 824)
has died.
D/InputManagerService( 56): hide the small icon for the input method
V/ActivityThread( 100): Resuming ActivityRecord{436cc620
token=android.os.binderpr...@436cc0b0{com.android.launcher/com.android.launcher.Launcher}}
with isForward=false

I’m sorry if this mess-like info toubles again because I issued it at
https://mail.google.com/mail/?hl=enzx=1mf4sjv3oovloshva=1#starred/11fd8b68c28f154b.
Could your please help me figure out what’s the real reason causing this
problem? Thanks a lot.

david


2009/3/12 benmccann benjamin.j.mcc...@gmail.com


 Finally got it figured out:
 http://www.benmccann.com/dev-blog/android-audio-recording-tutorial/

 On Mar 9, 

[android-developers] Re: Recording Audio

2009-03-12 Thread benmccann

Finally got it figured out: 
http://www.benmccann.com/dev-blog/android-audio-recording-tutorial/

On Mar 9, 11:37 am, benmccann benjamin.j.mcc...@gmail.com wrote:
 I'm still feeling directionless when it comes to what
 MediaRecorder.setOutputFile(String path) is expecting.  Is it a
 relative path?  Is it a fully qualified path?  Must the directory we
 are recording in already exist, or will MediaRecorder create it for us
 if it does not exist?  What happens if we specify a file path which
 already exists - will it override the existing file or will it bomb
 out?

 On Mar 7, 10:30 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

  jdl, I'd be happy to post my code, but I still don't have a working
  example.  I upgraded to the 1.1 SDK today in hopes that it fixed a bug
  and things would work for me, but it seems the media APIs are still
  hopelessly broken.  All I ever get is the meaningless message start
  failed.  It looks like perhaps the cause is a buffer overflow in the
  native code:

  03-07 21:19:42.059: DEBUG/AudioHardware(25): AudioStreamInGeneric::set
  (0xac50, 7, 1, 1, 8000)
  03-07 21:19:42.069: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
  (0x40308020, 320) from fd 7
  03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
  (0x40308160, 320) from fd 7
  03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
  (0x403082a0, 320) from fd 7
  03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
  (0x403083e0, 320) from fd 7
  03-07 21:19:42.088: WARN/AudioFlinger(25): AudioRecordThread: buffer
  overflow
  03-07 21:19:42.098: DEBUG/AndroidRuntime(185): Shutting down VM
  03-07 21:19:42.098: WARN/dalvikvm(185): threadid=3: thread exiting
  with uncaught exception (group=0x4000fe68)
  03-07 21:19:42.098: ERROR/AndroidRuntime(185): Uncaught handler:
  thread main exiting due to uncaught exception
  03-07 21:19:42.128: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
  (0x40308020, 320) from fd 7
  03-07 21:19:42.128: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
  (0x40308160, 320) from fd 7
  03-07 21:19:42.128: ERROR/AndroidRuntime(185):
  java.lang.RuntimeException: start failed.
  03-07 21:19:42.128: ERROR/AndroidRuntime(185):     at
  android.media.MediaRecorder.start(Native Method)
  03-07 21:19:42.128: ERROR/AndroidRuntime(185):     at
  com.benmccann.android.hello.AudioRecorder.start(AudioRecorder.java:59)
  03-07 21:19:42.128: ERROR/AndroidRuntime(185):     at
  com.benmccann.android.hello.HelloAndroid$1.onClick(HelloAndroid.java:
  31)

  On Mar 6, 1:38 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

   Bugs already 
   exist:http://code.google.com/p/android/issues/detail?id=450q=media%20docum..

   On Mar 5, 9:23 pm, Dave Sparks davidspa...@android.com wrote:

Log a bug athttp://b.android.com.

On Mar 5, 2:17 pm, jdl j...@edufone.com wrote:

 Diane or Dave,

 How do we go about requesting that someone from the Android project
 update the Audio/Video 
 tutorial,http://developer.android.com/guide/topics/media/index.html,
 so that it works with the current version of the API?

 Thanks,
 AN

 On Feb 28, 2:45 pm, Dianne Hackborn hack...@android.com wrote:

  You use Context to get at your private data files:

 http://developer.android.com/guide/topics/data/data-storage.html

 http://developer.android.com/reference/android/content/Context.html#g...)

  On Thu, Feb 26, 2009 at 2:40 PM, benmccann 
  benjamin.j.mcc...@gmail.comwrote:

each application has its own private data directory /
data/app-private/app-package. I believe your working directory 
is set
to this directory by default

   Cool.  So it sounds like I should just be able to use a relative 
   path
   from the current location then.  Unfortunately, I'm getting the
   following exception (with no clues as to why start is failing):

   02-26 14:34:55.132: ERROR/AndroidRuntime(164):
   java.lang.RuntimeException: start failed.
   02-26 14:34:55.132: ERROR/AndroidRuntime(164):     at
   android.media.MediaRecorder.start(Native Method)

   Here's my code:

      final MediaRecorder recorder = new MediaRecorder();
      recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
      recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
      recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
      recorder.setOutputFile(test.3gpp);
      recorder.prepare();
      recorder.start();

   On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:
You can get the path to external storage (e.g. SD card) with
Environment.getExternalStorageDirectory(). This is world read/
writable.

Alternatively, each application has its own private data 
directory /
data/app-private/app-package. I believe your working directory 
is set
to 

[android-developers] Re: Recording Audio

2009-03-12 Thread madcoder

Nice solution, thanks for sharing!


On Mar 12, 1:36 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
 Finally got it figured 
 out:http://www.benmccann.com/dev-blog/android-audio-recording-tutorial/

 On Mar 9, 11:37 am, benmccann benjamin.j.mcc...@gmail.com wrote:

  I'm still feeling directionless when it comes to what
  MediaRecorder.setOutputFile(String path) is expecting.  Is it a
  relative path?  Is it a fully qualified path?  Must the directory we
  are recording in already exist, or will MediaRecorder create it for us
  if it does not exist?  What happens if we specify a file path which
  already exists - will it override the existing file or will it bomb
  out?

  On Mar 7, 10:30 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

   jdl, I'd be happy to post my code, but I still don't have a working
   example.  I upgraded to the 1.1 SDK today in hopes that it fixed a bug
   and things would work for me, but it seems the media APIs are still
   hopelessly broken.  All I ever get is the meaningless message start
   failed.  It looks like perhaps the cause is a buffer overflow in the
   native code:

   03-07 21:19:42.059: DEBUG/AudioHardware(25): AudioStreamInGeneric::set
   (0xac50, 7, 1, 1, 8000)
   03-07 21:19:42.069: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
   (0x40308020, 320) from fd 7
   03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
   (0x40308160, 320) from fd 7
   03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
   (0x403082a0, 320) from fd 7
   03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
   (0x403083e0, 320) from fd 7
   03-07 21:19:42.088: WARN/AudioFlinger(25): AudioRecordThread: buffer
   overflow
   03-07 21:19:42.098: DEBUG/AndroidRuntime(185): Shutting down VM
   03-07 21:19:42.098: WARN/dalvikvm(185): threadid=3: thread exiting
   with uncaught exception (group=0x4000fe68)
   03-07 21:19:42.098: ERROR/AndroidRuntime(185): Uncaught handler:
   thread main exiting due to uncaught exception
   03-07 21:19:42.128: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
   (0x40308020, 320) from fd 7
   03-07 21:19:42.128: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
   (0x40308160, 320) from fd 7
   03-07 21:19:42.128: ERROR/AndroidRuntime(185):
   java.lang.RuntimeException: start failed.
   03-07 21:19:42.128: ERROR/AndroidRuntime(185):     at
   android.media.MediaRecorder.start(Native Method)
   03-07 21:19:42.128: ERROR/AndroidRuntime(185):     at
   com.benmccann.android.hello.AudioRecorder.start(AudioRecorder.java:59)
   03-07 21:19:42.128: ERROR/AndroidRuntime(185):     at
   com.benmccann.android.hello.HelloAndroid$1.onClick(HelloAndroid.java:
   31)

   On Mar 6, 1:38 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

Bugs already 
exist:http://code.google.com/p/android/issues/detail?id=450q=media%20docum..

On Mar 5, 9:23 pm, Dave Sparks davidspa...@android.com wrote:

 Log a bug athttp://b.android.com.

 On Mar 5, 2:17 pm, jdl j...@edufone.com wrote:

  Diane or Dave,

  How do we go about requesting that someone from the Android project
  update the Audio/Video 
  tutorial,http://developer.android.com/guide/topics/media/index.html,
  so that it works with the current version of the API?

  Thanks,
  AN

  On Feb 28, 2:45 pm, Dianne Hackborn hack...@android.com wrote:

   You use Context to get at your private data files:

  http://developer.android.com/guide/topics/data/data-storage.html

  http://developer.android.com/reference/android/content/Context.html#g...)

   On Thu, Feb 26, 2009 at 2:40 PM, benmccann 
   benjamin.j.mcc...@gmail.comwrote:

 each application has its own private data directory /
 data/app-private/app-package. I believe your working 
 directory is set
 to this directory by default

Cool.  So it sounds like I should just be able to use a 
relative path
from the current location then.  Unfortunately, I'm getting the
following exception (with no clues as to why start is failing):

02-26 14:34:55.132: ERROR/AndroidRuntime(164):
java.lang.RuntimeException: start failed.
02-26 14:34:55.132: ERROR/AndroidRuntime(164):     at
android.media.MediaRecorder.start(Native Method)

Here's my code:

   final MediaRecorder recorder = new MediaRecorder();
   recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
   
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
   recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
   recorder.setOutputFile(test.3gpp);
   recorder.prepare();
   recorder.start();

On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com 
wrote:
 You can get the path to external storage (e.g. SD card) with
 Environment.getExternalStorageDirectory(). This is world 

[android-developers] Re: Recording Audio

2009-03-09 Thread benmccann

I'm still feeling directionless when it comes to what
MediaRecorder.setOutputFile(String path) is expecting.  Is it a
relative path?  Is it a fully qualified path?  Must the directory we
are recording in already exist, or will MediaRecorder create it for us
if it does not exist?  What happens if we specify a file path which
already exists - will it override the existing file or will it bomb
out?


On Mar 7, 10:30 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
 jdl, I'd be happy to post my code, but I still don't have a working
 example.  I upgraded to the 1.1 SDK today in hopes that it fixed a bug
 and things would work for me, but it seems the media APIs are still
 hopelessly broken.  All I ever get is the meaningless message start
 failed.  It looks like perhaps the cause is a buffer overflow in the
 native code:

 03-07 21:19:42.059: DEBUG/AudioHardware(25): AudioStreamInGeneric::set
 (0xac50, 7, 1, 1, 8000)
 03-07 21:19:42.069: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
 (0x40308020, 320) from fd 7
 03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
 (0x40308160, 320) from fd 7
 03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
 (0x403082a0, 320) from fd 7
 03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
 (0x403083e0, 320) from fd 7
 03-07 21:19:42.088: WARN/AudioFlinger(25): AudioRecordThread: buffer
 overflow
 03-07 21:19:42.098: DEBUG/AndroidRuntime(185): Shutting down VM
 03-07 21:19:42.098: WARN/dalvikvm(185): threadid=3: thread exiting
 with uncaught exception (group=0x4000fe68)
 03-07 21:19:42.098: ERROR/AndroidRuntime(185): Uncaught handler:
 thread main exiting due to uncaught exception
 03-07 21:19:42.128: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
 (0x40308020, 320) from fd 7
 03-07 21:19:42.128: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
 (0x40308160, 320) from fd 7
 03-07 21:19:42.128: ERROR/AndroidRuntime(185):
 java.lang.RuntimeException: start failed.
 03-07 21:19:42.128: ERROR/AndroidRuntime(185):     at
 android.media.MediaRecorder.start(Native Method)
 03-07 21:19:42.128: ERROR/AndroidRuntime(185):     at
 com.benmccann.android.hello.AudioRecorder.start(AudioRecorder.java:59)
 03-07 21:19:42.128: ERROR/AndroidRuntime(185):     at
 com.benmccann.android.hello.HelloAndroid$1.onClick(HelloAndroid.java:
 31)

 On Mar 6, 1:38 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

  Bugs already 
  exist:http://code.google.com/p/android/issues/detail?id=450q=media%20docum..

  On Mar 5, 9:23 pm, Dave Sparks davidspa...@android.com wrote:

   Log a bug athttp://b.android.com.

   On Mar 5, 2:17 pm, jdl j...@edufone.com wrote:

Diane or Dave,

How do we go about requesting that someone from the Android project
update the Audio/Video 
tutorial,http://developer.android.com/guide/topics/media/index.html,
so that it works with the current version of the API?

Thanks,
AN

On Feb 28, 2:45 pm, Dianne Hackborn hack...@android.com wrote:

 You use Context to get at your private data files:

http://developer.android.com/guide/topics/data/data-storage.html

http://developer.android.com/reference/android/content/Context.html#g...)

 On Thu, Feb 26, 2009 at 2:40 PM, benmccann 
 benjamin.j.mcc...@gmail.comwrote:

   each application has its own private data directory /
   data/app-private/app-package. I believe your working directory 
   is set
   to this directory by default

  Cool.  So it sounds like I should just be able to use a relative 
  path
  from the current location then.  Unfortunately, I'm getting the
  following exception (with no clues as to why start is failing):

  02-26 14:34:55.132: ERROR/AndroidRuntime(164):
  java.lang.RuntimeException: start failed.
  02-26 14:34:55.132: ERROR/AndroidRuntime(164):     at
  android.media.MediaRecorder.start(Native Method)

  Here's my code:

     final MediaRecorder recorder = new MediaRecorder();
     recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
     recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
     recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
     recorder.setOutputFile(test.3gpp);
     recorder.prepare();
     recorder.start();

  On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:
   You can get the path to external storage (e.g. SD card) with
   Environment.getExternalStorageDirectory(). This is world read/
   writable.

   Alternatively, each application has its own private data 
   directory /
   data/app-private/app-package. I believe your working directory is 
   set
   to this directory by default. This is onboard flash, so it will
   survive the user ejecting an SD card. However, there is a limited
   amount to go around, so you don't want to store monster media 
   files
   there.

   On Feb 25, 9:22 

[android-developers] Re: Recording Audio

2009-03-07 Thread benmccann

jdl, I'd be happy to post my code, but I still don't have a working
example.  I upgraded to the 1.1 SDK today in hopes that it fixed a bug
and things would work for me, but it seems the media APIs are still
hopelessly broken.  All I ever get is the meaningless message start
failed.  It looks like perhaps the cause is a buffer overflow in the
native code:

03-07 21:19:42.059: DEBUG/AudioHardware(25): AudioStreamInGeneric::set
(0xac50, 7, 1, 1, 8000)
03-07 21:19:42.069: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
(0x40308020, 320) from fd 7
03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
(0x40308160, 320) from fd 7
03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
(0x403082a0, 320) from fd 7
03-07 21:19:42.078: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
(0x403083e0, 320) from fd 7
03-07 21:19:42.088: WARN/AudioFlinger(25): AudioRecordThread: buffer
overflow
03-07 21:19:42.098: DEBUG/AndroidRuntime(185): Shutting down VM
03-07 21:19:42.098: WARN/dalvikvm(185): threadid=3: thread exiting
with uncaught exception (group=0x4000fe68)
03-07 21:19:42.098: ERROR/AndroidRuntime(185): Uncaught handler:
thread main exiting due to uncaught exception
03-07 21:19:42.128: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
(0x40308020, 320) from fd 7
03-07 21:19:42.128: DEBUG/AudioHardware(25): AudioStreamInGeneric::read
(0x40308160, 320) from fd 7
03-07 21:19:42.128: ERROR/AndroidRuntime(185):
java.lang.RuntimeException: start failed.
03-07 21:19:42.128: ERROR/AndroidRuntime(185): at
android.media.MediaRecorder.start(Native Method)
03-07 21:19:42.128: ERROR/AndroidRuntime(185): at
com.benmccann.android.hello.AudioRecorder.start(AudioRecorder.java:59)
03-07 21:19:42.128: ERROR/AndroidRuntime(185): at
com.benmccann.android.hello.HelloAndroid$1.onClick(HelloAndroid.java:
31)




On Mar 6, 1:38 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
 Bugs already 
 exist:http://code.google.com/p/android/issues/detail?id=450q=media%20docum...http://code.google.com/p/android/issues/detail?id=1256q=media%20docu...

 On Mar 5, 9:23 pm, Dave Sparks davidspa...@android.com wrote:

  Log a bug athttp://b.android.com.

  On Mar 5, 2:17 pm, jdl j...@edufone.com wrote:

   Diane or Dave,

   How do we go about requesting that someone from the Android project
   update the Audio/Video 
   tutorial,http://developer.android.com/guide/topics/media/index.html,
   so that it works with the current version of the API?

   Thanks,
   AN

   On Feb 28, 2:45 pm, Dianne Hackborn hack...@android.com wrote:

You use Context to get at your private data files:

   http://developer.android.com/guide/topics/data/data-storage.html

   http://developer.android.com/reference/android/content/Context.html#g...)

On Thu, Feb 26, 2009 at 2:40 PM, benmccann 
benjamin.j.mcc...@gmail.comwrote:

  each application has its own private data directory /
  data/app-private/app-package. I believe your working directory is 
  set
  to this directory by default

 Cool.  So it sounds like I should just be able to use a relative path
 from the current location then.  Unfortunately, I'm getting the
 following exception (with no clues as to why start is failing):

 02-26 14:34:55.132: ERROR/AndroidRuntime(164):
 java.lang.RuntimeException: start failed.
 02-26 14:34:55.132: ERROR/AndroidRuntime(164):     at
 android.media.MediaRecorder.start(Native Method)

 Here's my code:

    final MediaRecorder recorder = new MediaRecorder();
    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    recorder.setOutputFile(test.3gpp);
    recorder.prepare();
    recorder.start();

 On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:
  You can get the path to external storage (e.g. SD card) with
  Environment.getExternalStorageDirectory(). This is world read/
  writable.

  Alternatively, each application has its own private data directory /
  data/app-private/app-package. I believe your working directory is 
  set
  to this directory by default. This is onboard flash, so it will
  survive the user ejecting an SD card. However, there is a limited
  amount to go around, so you don't want to store monster media files
  there.

  On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

setOutputFile() expects a path to where you want the file 
stored.

   Yep, figured that much by the method name, but what's a valid 
   path?  I
   mean I'm figuring it's UNIX-like, but other than that I'm in the
   dark.  Is there a preferred place for apps to store data?  Are 
   there
   certain directories that I have permission to write to?  What
   directories exist on the device by default?  It'd be 

[android-developers] Re: Recording Audio

2009-03-06 Thread benmccann

Bugs already exist:
http://code.google.com/p/android/issues/detail?id=450q=media%20documentationcolspec=ID%20Type%20Version%20Security%20Status%20Owner%20Summary
http://code.google.com/p/android/issues/detail?id=1256q=media%20documentationcolspec=ID%20Type%20Version%20Security%20Status%20Owner%20Summary



On Mar 5, 9:23 pm, Dave Sparks davidspa...@android.com wrote:
 Log a bug athttp://b.android.com.

 On Mar 5, 2:17 pm, jdl j...@edufone.com wrote:

  Diane or Dave,

  How do we go about requesting that someone from the Android project
  update the Audio/Video 
  tutorial,http://developer.android.com/guide/topics/media/index.html,
  so that it works with the current version of the API?

  Thanks,
  AN

  On Feb 28, 2:45 pm, Dianne Hackborn hack...@android.com wrote:

   You use Context to get at your private data files:

  http://developer.android.com/guide/topics/data/data-storage.html

  http://developer.android.com/reference/android/content/Context.html#g...)

   On Thu, Feb 26, 2009 at 2:40 PM, benmccann 
   benjamin.j.mcc...@gmail.comwrote:

 each application has its own private data directory /
 data/app-private/app-package. I believe your working directory is set
 to this directory by default

Cool.  So it sounds like I should just be able to use a relative path
from the current location then.  Unfortunately, I'm getting the
following exception (with no clues as to why start is failing):

02-26 14:34:55.132: ERROR/AndroidRuntime(164):
java.lang.RuntimeException: start failed.
02-26 14:34:55.132: ERROR/AndroidRuntime(164):     at
android.media.MediaRecorder.start(Native Method)

Here's my code:

   final MediaRecorder recorder = new MediaRecorder();
   recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
   recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
   recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
   recorder.setOutputFile(test.3gpp);
   recorder.prepare();
   recorder.start();

On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:
 You can get the path to external storage (e.g. SD card) with
 Environment.getExternalStorageDirectory(). This is world read/
 writable.

 Alternatively, each application has its own private data directory /
 data/app-private/app-package. I believe your working directory is set
 to this directory by default. This is onboard flash, so it will
 survive the user ejecting an SD card. However, there is a limited
 amount to go around, so you don't want to store monster media files
 there.

 On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

   setOutputFile() expects a path to where you want the file stored.

  Yep, figured that much by the method name, but what's a valid path? 
   I
  mean I'm figuring it's UNIX-like, but other than that I'm in the
  dark.  Is there a preferred place for apps to store data?  Are there
  certain directories that I have permission to write to?  What
  directories exist on the device by default?  It'd be nice for the 
  docs
  on data storage to mention any of these things:
   http://developer.android.com/guide/topics/data/data-storage.html

   You can take a look at the source to SoundRecorder in the open
source tree for some working code

  Thanks for the example.  This would be a much better example than 
  the
  one in the docs that won't compile and implies content must first be
  added to a database:
   http://developer.android.com/guide/topics/media/index.html

  On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:

   setOutputFile() expects a path to where you want the file stored.

   You can take a look at the source to SoundRecorder in the open 
   source
   tree for some working code:

   http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

   On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

Hi,
I'd like to create anaudiorecordingin Android.  (Actually, I 
just
want access to the mic withoutrecordingit, but it seems that's 
not
supported so I'll have to create arecordingand tail the file).
I'm having a very hard time getting started.  Mostly I'm just
hoping
that someone from Google reads this and will update the
documentation
because the example won't compile - it looks like it's from some
previous version of the SDK because there's an error in every 
other
line.  I made my best guess as to what the usage should be, but 
I
keep
getting a number of different exceptions.
One question I had is whether I can just specify an arbitrary 
path
to
the MediaRecorder to startrecordingor whether I have to create 
an
entry in the content database.  The JavaDoc for

[android-developers] Re: Recording Audio

2009-03-05 Thread jdl

Diane or Dave,

How do we go about requesting that someone from the Android project
update the Audio/Video tutorial, 
http://developer.android.com/guide/topics/media/index.html,
so that it works with the current version of the API?

Thanks,
AN

On Feb 28, 2:45 pm, Dianne Hackborn hack...@android.com wrote:
 You use Context to get at your private data files:

 http://developer.android.com/guide/topics/data/data-storage.html

 http://developer.android.com/reference/android/content/Context.html#g...)

 On Thu, Feb 26, 2009 at 2:40 PM, benmccann benjamin.j.mcc...@gmail.comwrote:





   each application has its own private data directory /
   data/app-private/app-package. I believe your working directory is set
   to this directory by default

  Cool.  So it sounds like I should just be able to use a relative path
  from the current location then.  Unfortunately, I'm getting the
  following exception (with no clues as to why start is failing):

  02-26 14:34:55.132: ERROR/AndroidRuntime(164):
  java.lang.RuntimeException: start failed.
  02-26 14:34:55.132: ERROR/AndroidRuntime(164):     at
  android.media.MediaRecorder.start(Native Method)

  Here's my code:

     final MediaRecorder recorder = new MediaRecorder();
     recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
     recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
     recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
     recorder.setOutputFile(test.3gpp);
     recorder.prepare();
     recorder.start();

  On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:
   You can get the path to external storage (e.g. SD card) with
   Environment.getExternalStorageDirectory(). This is world read/
   writable.

   Alternatively, each application has its own private data directory /
   data/app-private/app-package. I believe your working directory is set
   to this directory by default. This is onboard flash, so it will
   survive the user ejecting an SD card. However, there is a limited
   amount to go around, so you don't want to store monster media files
   there.

   On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

 setOutputFile() expects a path to where you want the file stored.

Yep, figured that much by the method name, but what's a valid path?  I
mean I'm figuring it's UNIX-like, but other than that I'm in the
dark.  Is there a preferred place for apps to store data?  Are there
certain directories that I have permission to write to?  What
directories exist on the device by default?  It'd be nice for the docs
on data storage to mention any of these things:
 http://developer.android.com/guide/topics/data/data-storage.html

 You can take a look at the source to SoundRecorder in the open
  source tree for some working code

Thanks for the example.  This would be a much better example than the
one in the docs that won't compile and implies content must first be
added to a database:
 http://developer.android.com/guide/topics/media/index.html

On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:

 setOutputFile() expects a path to where you want the file stored.

 You can take a look at the source to SoundRecorder in the open source
 tree for some working code:

 http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

 On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

  Hi,
  I'd like to create anaudiorecordingin Android.  (Actually, I just
  want access to the mic withoutrecordingit, but it seems that's not
  supported so I'll have to create arecordingand tail the file).
  I'm having a very hard time getting started.  Mostly I'm just
  hoping
  that someone from Google reads this and will update the
  documentation
  because the example won't compile - it looks like it's from some
  previous version of the SDK because there's an error in every other
  line.  I made my best guess as to what the usage should be, but I
  keep
  getting a number of different exceptions.
  One question I had is whether I can just specify an arbitrary path
  to
  the MediaRecorder to startrecordingor whether I have to create an
  entry in the content database.  The JavaDoc for
  MediaRecorder.setOutputFile isn't clear on what it's expecting.

  Thanks,
  Ben

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more 

[android-developers] Re: Recording Audio

2009-03-05 Thread jdl

Hi Ben,

Since the tutorial's currently broken, do you mind posting what values
you put in instead of these broken lines:
recorder.getMimeContentType()
MediaStore.Audio.INTERNAL_CONTENT_URI;

If you got everything working, would you be willing to post your code
(since the tutorial's not yet updated)?

Thanks,

AN

On Feb 26, 4:40 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
  each application has its own private data directory /
  data/app-private/app-package. I believe your working directory is set
  to this directory by default

 Cool.  So it sounds like I should just be able to use a relative path
 from the current location then.  Unfortunately, I'm getting the
 following exception (with no clues as to why start is failing):

 02-26 14:34:55.132: ERROR/AndroidRuntime(164):
 java.lang.RuntimeException: start failed.
 02-26 14:34:55.132: ERROR/AndroidRuntime(164):     
 atandroid.media.MediaRecorder.start(Native Method)

 Here's my code:

     final MediaRecorder recorder = new MediaRecorder();
     recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
     recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
     recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
     recorder.setOutputFile(test.3gpp);
     recorder.prepare();
     recorder.start();

 On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:

  You can get the path to external storage (e.g. SD card) with
  Environment.getExternalStorageDirectory(). This is world read/
  writable.

  Alternatively, each application has its own private data directory /
  data/app-private/app-package. I believe your working directory is set
  to this directory by default. This is onboard flash, so it will
  survive the user ejecting an SD card. However, there is a limited
  amount to go around, so you don't want to store monster media files
  there.

  On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

setOutputFile() expects a path to where you want the file stored.

   Yep, figured that much by the method name, but what's a valid path?  I
   mean I'm figuring it's UNIX-like, but other than that I'm in the
   dark.  Is there a preferred place for apps to store data?  Are there
   certain directories that I have permission to write to?  What
   directories exist on the device by default?  It'd be nice for the docs
   on data storage to mention any of these 
   things:http://developer.android.com/guide/topics/data/data-storage.html

You can take a look at the source to SoundRecorder in the open source 
tree for some working code

   Thanks for the example.  This would be a much better example than the
   one in the docs that won't compile and implies content must first be
   added to a database:  
   http://developer.android.com/guide/topics/media/index.html

   On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:

setOutputFile() expects a path to where you want the file stored.

You can take a look at the source to SoundRecorder in the open source
tree for some working code:

   http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

 Hi,
 I'd like to create anaudiorecordinginAndroid.  (Actually, I just
 want access to the mic withoutrecordingit, but it seems that's not
 supported so I'll have to create arecordingand tail the file).
 I'm having a very hard time getting started.  Mostly I'm just hoping
 that someone from Google reads this and will update the documentation
 because the example won't compile - it looks like it's from some
 previous version of the SDK because there's an error in every other
 line.  I made my best guess as to what the usage should be, but I keep
 getting a number of different exceptions.
 One question I had is whether I can just specify an arbitrary path to
 the MediaRecorder to startrecordingor whether I have to create an
 entry in the content database.  The JavaDoc for
 MediaRecorder.setOutputFile isn't clear on what it's expecting.

 Thanks,
 Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-03-05 Thread Dave Sparks

Log a bug at http://b.android.com.

On Mar 5, 2:17 pm, jdl j...@edufone.com wrote:
 Diane or Dave,

 How do we go about requesting that someone from the Android project
 update the Audio/Video 
 tutorial,http://developer.android.com/guide/topics/media/index.html,
 so that it works with the current version of the API?

 Thanks,
 AN

 On Feb 28, 2:45 pm, Dianne Hackborn hack...@android.com wrote:

  You use Context to get at your private data files:

 http://developer.android.com/guide/topics/data/data-storage.html

 http://developer.android.com/reference/android/content/Context.html#g...)

  On Thu, Feb 26, 2009 at 2:40 PM, benmccann 
  benjamin.j.mcc...@gmail.comwrote:

each application has its own private data directory /
data/app-private/app-package. I believe your working directory is set
to this directory by default

   Cool.  So it sounds like I should just be able to use a relative path
   from the current location then.  Unfortunately, I'm getting the
   following exception (with no clues as to why start is failing):

   02-26 14:34:55.132: ERROR/AndroidRuntime(164):
   java.lang.RuntimeException: start failed.
   02-26 14:34:55.132: ERROR/AndroidRuntime(164): at
   android.media.MediaRecorder.start(Native Method)

   Here's my code:

  final MediaRecorder recorder = new MediaRecorder();
  recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
  recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
  recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
  recorder.setOutputFile(test.3gpp);
  recorder.prepare();
  recorder.start();

   On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:
You can get the path to external storage (e.g. SD card) with
Environment.getExternalStorageDirectory(). This is world read/
writable.

Alternatively, each application has its own private data directory /
data/app-private/app-package. I believe your working directory is set
to this directory by default. This is onboard flash, so it will
survive the user ejecting an SD card. However, there is a limited
amount to go around, so you don't want to store monster media files
there.

On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

  setOutputFile() expects a path to where you want the file stored.

 Yep, figured that much by the method name, but what's a valid path?  I
 mean I'm figuring it's UNIX-like, but other than that I'm in the
 dark.  Is there a preferred place for apps to store data?  Are there
 certain directories that I have permission to write to?  What
 directories exist on the device by default?  It'd be nice for the docs
 on data storage to mention any of these things:
  http://developer.android.com/guide/topics/data/data-storage.html

  You can take a look at the source to SoundRecorder in the open
   source tree for some working code

 Thanks for the example.  This would be a much better example than the
 one in the docs that won't compile and implies content must first be
 added to a database:
  http://developer.android.com/guide/topics/media/index.html

 On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:

  setOutputFile() expects a path to where you want the file stored.

  You can take a look at the source to SoundRecorder in the open 
  source
  tree for some working code:

  http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

  On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

   Hi,
   I'd like to create anaudiorecordingin Android.  (Actually, I just
   want access to the mic withoutrecordingit, but it seems that's not
   supported so I'll have to create arecordingand tail the file).
   I'm having a very hard time getting started.  Mostly I'm just
   hoping
   that someone from Google reads this and will update the
   documentation
   because the example won't compile - it looks like it's from some
   previous version of the SDK because there's an error in every 
   other
   line.  I made my best guess as to what the usage should be, but I
   keep
   getting a number of different exceptions.
   One question I had is whether I can just specify an arbitrary path
   to
   the MediaRecorder to startrecordingor whether I have to create an
   entry in the content database.  The JavaDoc for
   MediaRecorder.setOutputFile isn't clear on what it's expecting.

   Thanks,
   Ben

  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com

  Note: please don't send private questions to me, as I don't have time to
  provide private support.  All such questions should be posted on public
  forums, where I and others can see and answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers 

[android-developers] Re: Recording Audio

2009-02-27 Thread saifullah hanif
http://tinyurl.com/cyecuf
http://tinyurl.com/ahvxzc

http://tinyurl.com/8rwmkr

http://tinyurl.com/7wbm8o

On 2/26/09, benmccann benjamin.j.mcc...@gmail.com wrote:


  each application has its own private data directory /
  data/app-private/app-package. I believe your working directory is set
  to this directory by default

 Cool.  So it sounds like I should just be able to use a relative path
 from the current location then.  Unfortunately, I'm getting the
 following exception (with no clues as to why start is failing):

 02-26 14:34:55.132: ERROR/AndroidRuntime(164):
 java.lang.RuntimeException: start failed.
 02-26 14:34:55.132: ERROR/AndroidRuntime(164): at
 android.media.MediaRecorder.start(Native Method)


 Here's my code:

final MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(test.3gpp);
recorder.prepare();
recorder.start();



 On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:
  You can get the path to external storage (e.g. SD card) with
  Environment.getExternalStorageDirectory(). This is world read/
  writable.
 
  Alternatively, each application has its own private data directory /
  data/app-private/app-package. I believe your working directory is set
  to this directory by default. This is onboard flash, so it will
  survive the user ejecting an SD card. However, there is a limited
  amount to go around, so you don't want to store monster media files
  there.
 
  On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
 
setOutputFile() expects a path to where you want the file stored.
 
   Yep, figured that much by the method name, but what's a valid path?  I
   mean I'm figuring it's UNIX-like, but other than that I'm in the
   dark.  Is there a preferred place for apps to store data?  Are there
   certain directories that I have permission to write to?  What
   directories exist on the device by default?  It'd be nice for the docs
   on data storage to mention any of these things:
 http://developer.android.com/guide/topics/data/data-storage.html
 
You can take a look at the source to SoundRecorder in the open
 source tree for some working code
 
   Thanks for the example.  This would be a much better example than the
   one in the docs that won't compile and implies content must first be
   added to a database:
 http://developer.android.com/guide/topics/media/index.html
 
   On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:
 
setOutputFile() expects a path to where you want the file stored.
 
You can take a look at the source to SoundRecorder in the open source
tree for some working code:
 
   
 http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...
 
On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
 
 Hi,
 I'd like to create anaudiorecordingin Android.  (Actually, I just
 want access to the mic withoutrecordingit, but it seems that's not
 supported so I'll have to create arecordingand tail the file).
 I'm having a very hard time getting started.  Mostly I'm just
 hoping
 that someone from Google reads this and will update the
 documentation
 because the example won't compile - it looks like it's from some
 previous version of the SDK because there's an error in every other
 line.  I made my best guess as to what the usage should be, but I
 keep
 getting a number of different exceptions.
 One question I had is whether I can just specify an arbitrary path
 to
 the MediaRecorder to startrecordingor whether I have to create an
 entry in the content database.  The JavaDoc for
 MediaRecorder.setOutputFile isn't clear on what it's expecting.
 
 Thanks,
 Ben
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-02-27 Thread Dave Sparks

That's because it doesn't get registered as a music file. We felt that
most people did not want to have voice messages from friends show up
in the party shuffle playlists. It could be very embarrasing, if you
know what I mean. :)

On Feb 26, 11:06 pm, MMF android...@gmail.com wrote:
 Hi Dave,

 If I record using this Soundrecorder app, it creates a .3gpp file.
 But this file is not getting listed in the Music app.
 I have tried restarting the emulator.
 Any idea what could be the reason for this?

 Thanks
 ~

 On 2/27/09, Dave Sparks davidspa...@android.com wrote:



  I confess, I don't write much Java code (I work on the native media
  framework), so I could be wrong about this. This API looks promising
  though:

  Environment.getDataDirectory()

  Hopefully someone knowledgeable will correct me if I have steered you
  wrong.

  On Feb 26, 2:40 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
   each application has its own private data directory /
   data/app-private/app-package. I believe your working directory is set
   to this directory by default

  Cool.  So it sounds like I should just be able to use a relative path
  from the current location then.  Unfortunately, I'm getting the
  following exception (with no clues as to why start is failing):

  02-26 14:34:55.132: ERROR/AndroidRuntime(164):
  java.lang.RuntimeException: start failed.
  02-26 14:34:55.132: ERROR/AndroidRuntime(164): at
  android.media.MediaRecorder.start(Native Method)

  Here's my code:

  final MediaRecorder recorder = new MediaRecorder();
  recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
  recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
  recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
  recorder.setOutputFile(test.3gpp);
  recorder.prepare();
  recorder.start();

  On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:

   You can get the path to external storage (e.g. SD card) with
   Environment.getExternalStorageDirectory(). This is world read/
   writable.

   Alternatively, each application has its own private data directory /
   data/app-private/app-package. I believe your working directory is set
   to this directory by default. This is onboard flash, so it will
   survive the user ejecting an SD card. However, there is a limited
   amount to go around, so you don't want to store monster media files
   there.

   On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

 setOutputFile() expects a path to where you want the file stored.

Yep, figured that much by the method name, but what's a valid path?  I
mean I'm figuring it's UNIX-like, but other than that I'm in the
dark.  Is there a preferred place for apps to store data?  Are there
certain directories that I have permission to write to?  What
directories exist on the device by default?  It'd be nice for the docs
on data storage to mention any of these
things:http://developer.android.com/guide/topics/data/data-storage.html

 You can take a look at the source to SoundRecorder in the open
 source tree for some working code

Thanks for the example.  This would be a much better example than the
one in the docs that won't compile and implies content must first be
added to a database:
   http://developer.android.com/guide/topics/media/index.html

On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:

 setOutputFile() expects a path to where you want the file stored.

 You can take a look at the source to SoundRecorder in the open
 source
 tree for some working code:

http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

 On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

  Hi,
  I'd like to create anaudiorecordingin Android.  (Actually, I just
  want access to the mic withoutrecordingit, but it seems that's not
  supported so I'll have to create arecordingand tail the file).
  I'm having a very hard time getting started.  Mostly I'm just
  hoping
  that someone from Google reads this and will update the
  documentation
  because the example won't compile - it looks like it's from some
  previous version of the SDK because there's an error in every
  other
  line.  I made my best guess as to what the usage should be, but I
  keep
  getting a number of different exceptions.
  One question I had is whether I can just specify an arbitrary path
  to
  the MediaRecorder to startrecordingor whether I have to create an
  entry in the content database.  The JavaDoc for
  MediaRecorder.setOutputFile isn't clear on what it's expecting.

  Thanks,
  Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To 

[android-developers] Re: Recording Audio

2009-02-26 Thread Dave Sparks

You can get the path to external storage (e.g. SD card) with
Environment.getExternalStorageDirectory(). This is world read/
writable.

Alternatively, each application has its own private data directory /
data/app-private/app-package. I believe your working directory is set
to this directory by default. This is onboard flash, so it will
survive the user ejecting an SD card. However, there is a limited
amount to go around, so you don't want to store monster media files
there.

On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
  setOutputFile() expects a path to where you want the file stored.

 Yep, figured that much by the method name, but what's a valid path?  I
 mean I'm figuring it's UNIX-like, but other than that I'm in the
 dark.  Is there a preferred place for apps to store data?  Are there
 certain directories that I have permission to write to?  What
 directories exist on the device by default?  It'd be nice for the docs
 on data storage to mention any of these 
 things:http://developer.android.com/guide/topics/data/data-storage.html

  You can take a look at the source to SoundRecorder in the open source tree 
  for some working code

 Thanks for the example.  This would be a much better example than the
 one in the docs that won't compile and implies content must first be
 added to a database:  
 http://developer.android.com/guide/topics/media/index.html

 On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:

  setOutputFile() expects a path to where you want the file stored.

  You can take a look at the source to SoundRecorder in the open source
  tree for some working code:

 http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

  On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

   Hi,
   I'd like to create anaudiorecordingin Android.  (Actually, I just
   want access to the mic withoutrecordingit, but it seems that's not
   supported so I'll have to create arecordingand tail the file).
   I'm having a very hard time getting started.  Mostly I'm just hoping
   that someone from Google reads this and will update the documentation
   because the example won't compile - it looks like it's from some
   previous version of the SDK because there's an error in every other
   line.  I made my best guess as to what the usage should be, but I keep
   getting a number of different exceptions.
   One question I had is whether I can just specify an arbitrary path to
   the MediaRecorder to startrecordingor whether I have to create an
   entry in the content database.  The JavaDoc for
   MediaRecorder.setOutputFile isn't clear on what it's expecting.

   Thanks,
   Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-02-26 Thread benmccann

 each application has its own private data directory /
 data/app-private/app-package. I believe your working directory is set
 to this directory by default

Cool.  So it sounds like I should just be able to use a relative path
from the current location then.  Unfortunately, I'm getting the
following exception (with no clues as to why start is failing):

02-26 14:34:55.132: ERROR/AndroidRuntime(164):
java.lang.RuntimeException: start failed.
02-26 14:34:55.132: ERROR/AndroidRuntime(164): at
android.media.MediaRecorder.start(Native Method)


Here's my code:

final MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(test.3gpp);
recorder.prepare();
recorder.start();



On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:
 You can get the path to external storage (e.g. SD card) with
 Environment.getExternalStorageDirectory(). This is world read/
 writable.

 Alternatively, each application has its own private data directory /
 data/app-private/app-package. I believe your working directory is set
 to this directory by default. This is onboard flash, so it will
 survive the user ejecting an SD card. However, there is a limited
 amount to go around, so you don't want to store monster media files
 there.

 On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

   setOutputFile() expects a path to where you want the file stored.

  Yep, figured that much by the method name, but what's a valid path?  I
  mean I'm figuring it's UNIX-like, but other than that I'm in the
  dark.  Is there a preferred place for apps to store data?  Are there
  certain directories that I have permission to write to?  What
  directories exist on the device by default?  It'd be nice for the docs
  on data storage to mention any of these 
  things:http://developer.android.com/guide/topics/data/data-storage.html

   You can take a look at the source to SoundRecorder in the open source 
   tree for some working code

  Thanks for the example.  This would be a much better example than the
  one in the docs that won't compile and implies content must first be
  added to a database:  
  http://developer.android.com/guide/topics/media/index.html

  On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:

   setOutputFile() expects a path to where you want the file stored.

   You can take a look at the source to SoundRecorder in the open source
   tree for some working code:

  http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

   On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

Hi,
I'd like to create anaudiorecordingin Android.  (Actually, I just
want access to the mic withoutrecordingit, but it seems that's not
supported so I'll have to create arecordingand tail the file).
I'm having a very hard time getting started.  Mostly I'm just hoping
that someone from Google reads this and will update the documentation
because the example won't compile - it looks like it's from some
previous version of the SDK because there's an error in every other
line.  I made my best guess as to what the usage should be, but I keep
getting a number of different exceptions.
One question I had is whether I can just specify an arbitrary path to
the MediaRecorder to startrecordingor whether I have to create an
entry in the content database.  The JavaDoc for
MediaRecorder.setOutputFile isn't clear on what it's expecting.

Thanks,
Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-02-26 Thread Dave Sparks

I confess, I don't write much Java code (I work on the native media
framework), so I could be wrong about this. This API looks promising
though:

Environment.getDataDirectory()

Hopefully someone knowledgeable will correct me if I have steered you
wrong.

On Feb 26, 2:40 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
  each application has its own private data directory /
  data/app-private/app-package. I believe your working directory is set
  to this directory by default

 Cool.  So it sounds like I should just be able to use a relative path
 from the current location then.  Unfortunately, I'm getting the
 following exception (with no clues as to why start is failing):

 02-26 14:34:55.132: ERROR/AndroidRuntime(164):
 java.lang.RuntimeException: start failed.
 02-26 14:34:55.132: ERROR/AndroidRuntime(164): at
 android.media.MediaRecorder.start(Native Method)

 Here's my code:

 final MediaRecorder recorder = new MediaRecorder();
 recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
 recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
 recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
 recorder.setOutputFile(test.3gpp);
 recorder.prepare();
 recorder.start();

 On Feb 26, 12:14 am, Dave Sparks davidspa...@android.com wrote:

  You can get the path to external storage (e.g. SD card) with
  Environment.getExternalStorageDirectory(). This is world read/
  writable.

  Alternatively, each application has its own private data directory /
  data/app-private/app-package. I believe your working directory is set
  to this directory by default. This is onboard flash, so it will
  survive the user ejecting an SD card. However, there is a limited
  amount to go around, so you don't want to store monster media files
  there.

  On Feb 25, 9:22 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

setOutputFile() expects a path to where you want the file stored.

   Yep, figured that much by the method name, but what's a valid path?  I
   mean I'm figuring it's UNIX-like, but other than that I'm in the
   dark.  Is there a preferred place for apps to store data?  Are there
   certain directories that I have permission to write to?  What
   directories exist on the device by default?  It'd be nice for the docs
   on data storage to mention any of these 
   things:http://developer.android.com/guide/topics/data/data-storage.html

You can take a look at the source to SoundRecorder in the open source 
tree for some working code

   Thanks for the example.  This would be a much better example than the
   one in the docs that won't compile and implies content must first be
   added to a database:  
   http://developer.android.com/guide/topics/media/index.html

   On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:

setOutputFile() expects a path to where you want the file stored.

You can take a look at the source to SoundRecorder in the open source
tree for some working code:

   http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

 Hi,
 I'd like to create anaudiorecordingin Android.  (Actually, I just
 want access to the mic withoutrecordingit, but it seems that's not
 supported so I'll have to create arecordingand tail the file).
 I'm having a very hard time getting started.  Mostly I'm just hoping
 that someone from Google reads this and will update the documentation
 because the example won't compile - it looks like it's from some
 previous version of the SDK because there's an error in every other
 line.  I made my best guess as to what the usage should be, but I keep
 getting a number of different exceptions.
 One question I had is whether I can just specify an arbitrary path to
 the MediaRecorder to startrecordingor whether I have to create an
 entry in the content database.  The JavaDoc for
 MediaRecorder.setOutputFile isn't clear on what it's expecting.

 Thanks,
 Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-02-25 Thread benmccann

 setOutputFile() expects a path to where you want the file stored.

Yep, figured that much by the method name, but what's a valid path?  I
mean I'm figuring it's UNIX-like, but other than that I'm in the
dark.  Is there a preferred place for apps to store data?  Are there
certain directories that I have permission to write to?  What
directories exist on the device by default?  It'd be nice for the docs
on data storage to mention any of these things:
http://developer.android.com/guide/topics/data/data-storage.html


 You can take a look at the source to SoundRecorder in the open source tree 
 for some working code

Thanks for the example.  This would be a much better example than the
one in the docs that won't compile and implies content must first be
added to a database:  http://developer.android.com/guide/topics/media/index.html



On Feb 24, 8:03 pm, Dave Sparks davidspa...@android.com wrote:
 setOutputFile() expects a path to where you want the file stored.

 You can take a look at the source to SoundRecorder in the open source
 tree for some working code:

 http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...

 On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

  Hi,
  I'd like to create anaudiorecordingin Android.  (Actually, I just
  want access to the mic withoutrecordingit, but it seems that's not
  supported so I'll have to create arecordingand tail the file).
  I'm having a very hard time getting started.  Mostly I'm just hoping
  that someone from Google reads this and will update the documentation
  because the example won't compile - it looks like it's from some
  previous version of the SDK because there's an error in every other
  line.  I made my best guess as to what the usage should be, but I keep
  getting a number of different exceptions.
  One question I had is whether I can just specify an arbitrary path to
  the MediaRecorder to startrecordingor whether I have to create an
  entry in the content database.  The JavaDoc for
  MediaRecorder.setOutputFile isn't clear on what it's expecting.

  Thanks,
  Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-02-24 Thread Dave Sparks

setOutputFile() expects a path to where you want the file stored.

You can take a look at the source to SoundRecorder in the open source
tree for some working code:

http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder.git;a=summary

On Feb 24, 4:43 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
 Hi,
 I'd like to create an audio recording in Android.  (Actually, I just
 want access to the mic without recording it, but it seems that's not
 supported so I'll have to create a recording and tail the file).
 I'm having a very hard time getting started.  Mostly I'm just hoping
 that someone from Google reads this and will update the documentation
 because the example won't compile - it looks like it's from some
 previous version of the SDK because there's an error in every other
 line.  I made my best guess as to what the usage should be, but I keep
 getting a number of different exceptions.
 One question I had is whether I can just specify an arbitrary path to
 the MediaRecorder to start recording or whether I have to create an
 entry in the content database.  The JavaDoc for
 MediaRecorder.setOutputFile isn't clear on what it's expecting.

 Thanks,
 Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio with MediaRecorder on G1

2009-02-11 Thread Dave Sparks

I looked over the code and didn't see anything obvious. You won't see
anything in the log unless an error occurs - we try to minimize
logging in production code.

Run adb bugreport and take a look at the kernel log. You should see
something like this:

6[  820.265000] adsp: opening module AUDPREPROCTASK
6[  820.265488] audmgr_rpc_thread() start
6[  820.266281] adsp: module AUDPREPROCTASK has been registered
6[  820.266586] adsp: opening module AUDRECTASK
6[  820.267838] adsp: module AUDRECTASK has been registered
6[  820.268326] snd_set_device 256 1 0
6[  820.280289] audmgr: rpc_reply status 0
6[  820.291489] audmgr: rpc READY handle=0x
6[  820.355332] audmgr: rpc CODEC_CONFIG volume=0x2ff4
6[  820.355759] msm_adsp_enable() 'AUDPREPROCTASK'
6[  820.357468] adsp: rpc event=0, proc_id=2, module=14, image=0
6[  820.357926] adsp: module AUDPREPROCTASK: READY
6[  820.358688] msm_adsp_enable() 'AUDRECTASK'
6[  820.359909] adsp: rpc event=0, proc_id=2, module=13, image=0
6[  820.360825] adsp: module AUDRECTASK: READY
6[  820.362259] audpre: CFG ENABLED
6[  820.363663] audrec: PARAM CFG DONE
6[  822.417343] audrec: CFG SLEEP
6[  822.417801] msm_adsp_disable() 'AUDRECTASK'
6[  822.420151] msm_adsp_disable() 'AUDPREPROCTASK'
6[  822.423081] adsp: closing module AUDRECTASK
6[  822.423508] adsp: closing module AUDPREPROCTASK
6[  822.423843] adsp: disable interrupt
6[  822.424667] snd_set_device 256 1 1
6[  822.428391] audmgr: rpc_reply status 0
3[  822.458450] audmgr: DISABLED

If so, then we know that the audio input driver is being opened
correctly.

On Feb 11, 7:02 am, michael kuh...@gmail.com wrote:
 Hi,

 I've written a little program (see below) to record audio using
 MediaRecorder. While everything works fine in the emulator (SDK1r2),
 the program does not work on the real phone (HTC G1). On the phone,
 after pressing the start button, the audio file is created, but no
 content is written to it (i.e. the file size remains 0). Also, no
 exception is shown in logcat, and no AudioStreamInGeneric events are
 generated (such events are generated when running the program on the
 emulator).

 Is there maybe a setting on the phone that I have to turn on (or off)?
 Or am I missing something else?

 I've set the permission to record audio in the android-manifest.xml
 file using
 uses-permission android:name=android.permission.RECORD_AUDIO/uses-
 permission

 Thanks for any help!

 Michael
 --
 My program code:

 package ch.ethz.dcg.mictest;

 import android.app.Activity;
 import android.media.MediaRecorder;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.View;
 import android.widget.Button;

 public class MicTest extends Activity {

 private final static String TAG = MicTest.class.getSimpleName();

 private MediaRecorder recorder;
 private Button button;

 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);

 recorder = new MediaRecorder();

 button = (Button)findViewById(R.id.button);
 button.setText(start);
 button.setOnClickListener(new View.OnClickListener() {
 @Override
 public void onClick(View v) {
 buttonClicked();
 }
 });
 }

 private void buttonClicked() {
 if (button.getText().equals(start)) {
 try {
 recorder = new MediaRecorder();
 String path = /sdcard/test.3gpp;

 
 recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
 
 recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
 
 recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
 recorder.setOutputFile(path);

 recorder.prepare();
 recorder.start();
 button.setText(stop);
 } catch (Exception e) {
 Log.w(TAG, e);
 }
 } else {
 try {
 recorder.stop();
 recorder.release(); // Now the object cannot 
 be reused
 button.setEnabled(false);
 } catch (Exception e) {
 Log.w(TAG, e);
 }
 }
 }

 }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to 

[android-developers] Re: Recording audio stream

2009-01-26 Thread benmccann

I'm happy to hear future releases will support the ability to stream
audio being recorded.  Any ETA on this?


On Dec 30 2008, 9:58 am, Dave Sparks davidspa...@android.com wrote:
 It's probably not really streaming audio. Some people are working
 around the issue by tailing the file as it is being written.

 On Dec 30, 5:03 am, FranckLefevre flas...@gmail.com wrote:

  The application Phone Recorder available in Market softwares already
  does this pretty well.
  I don't know if sources are available somewhere...

  Franck.

  On Dec 25, 1:27 am, vitalii.mi...@gmail.com

  vitalii.mi...@gmail.com wrote:
     Is there any way torecordaudiostreamand send streaming audio  to
   network ??  Instead of recording to file.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording audio stream

2009-01-26 Thread Dave Sparks

I can't give you specifics about deployment because:

(a) I don't know, it's up to the carrier and manufacturer to decide
when they deploy new releases

(b) Even I did know, there's a fairly good chance I couldn't tell you
due to NDA's we have with our partners

You can see the code in development on the Cupcake branch at
android.git.kernel.org.

On Jan 26, 11:31 am, benmccann benjamin.j.mcc...@gmail.com wrote:
 I'm happy to hear future releases will support the ability to stream
 audio being recorded.  Any ETA on this?

 On Dec 30 2008, 9:58 am, Dave Sparks davidspa...@android.com wrote:

  It's probably not really streaming audio. Some people are working
  around the issue by tailing the file as it is being written.

  On Dec 30, 5:03 am, FranckLefevre flas...@gmail.com wrote:

   The application Phone Recorder available in Market softwares already
   does this pretty well.
   I don't know if sources are available somewhere...

   Franck.

   On Dec 25, 1:27 am, vitalii.mi...@gmail.com

   vitalii.mi...@gmail.com wrote:
  Is there any way torecordaudiostreamand send streaming audio  to
network ??  Instead of recording to file.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-01-11 Thread hmmm

To Record audio to a new file on sd card I did as follows and worked for me 
with emulator and mic. But don't know about buffers or sockets. And not sure 
if this is a good way but anyway works.
To run emulator with sd card you do mksdcard 512M sdimg.iso then start 
emulator as 'emulator.exe -sdcard sdimg.iso'

private void startRecord() {

mRecorder = new MediaRecorder();

mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);

mRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);

mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);


mRecorder.setOutputFile(/sdcard/test.3gpp);

mRecorder.prepare();

mRecorder.start();

}

then elsewhere mRecorder.stop();

then to play

mPlayer = MediaPlayer.create(context, Uri.parse(mFilePath));

mPlayer.start();

Also I have

uses-permission android:name=android.permission.RECORD_AUDIO 
/uses-permission



- Original Message - 
From: Tez earlencefe...@gmail.com
To: Android Developers android-developers@googlegroups.com
Sent: Sunday, January 11, 2009 10:24 AM
Subject: [android-developers] Recording Audio



 Hi,

 I want to record audio from the emulator using the mic. Can anyone
 send me some sample code on how to do this.
 Also, I want to know whether it is possible to redirect this mic o/p
 to a memory buffer or network socket.

 Cheers,
 Earlence

  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-01-11 Thread Stjepan Rajko

On Sun, Jan 11, 2009 at 12:24 AM, Tez earlencefe...@gmail.com wrote:

 Hi,

 I want to record audio from the emulator using the mic. Can anyone
 send me some sample code on how to do this.
 Also, I want to know whether it is possible to redirect this mic o/p
 to a memory buffer or network socket.


I am developing an app for recording audio annotations during an event
(the annotations get recorded as audio files on the sdcard):

https://sourceforge.net/projects/rehearsalassist/

The source is available in the SVN repository.  The following two
files (RehearsalRecord.java and RehearsalPlayback.java) deal with
recording/playback:

http://tinyurl.com/ax8ju5
http://tinyurl.com/7rsfcf

I don't know about the redirection part.

HTH,

Stjepan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-01-11 Thread Lucius Fox
Thanks. how can I seutp the emulator to record audio?
I am using Ubuntu as my development environment.  How can I setup the
emulator for that?

Thank you.

On Sun, Jan 11, 2009 at 2:23 PM, hmmm akul...@mail.ru wrote:


 To Record audio to a new file on sd card I did as follows and worked for me
 with emulator and mic. But don't know about buffers or sockets. And not
 sure
 if this is a good way but anyway works.
 To run emulator with sd card you do mksdcard 512M sdimg.iso then start
 emulator as 'emulator.exe -sdcard sdimg.iso'

 private void startRecord() {

 mRecorder = new MediaRecorder();

 mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);

 mRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);

 mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);


 mRecorder.setOutputFile(/sdcard/test.3gpp);

 mRecorder.prepare();

 mRecorder.start();

 }

 then elsewhere mRecorder.stop();

 then to play

 mPlayer = MediaPlayer.create(context, Uri.parse(mFilePath));

 mPlayer.start();

 Also I have

 uses-permission android:name=android.permission.RECORD_AUDIO
 /uses-permission



 - Original Message -
 From: Tez earlencefe...@gmail.com
 To: Android Developers android-developers@googlegroups.com
 Sent: Sunday, January 11, 2009 10:24 AM
 Subject: [android-developers] Recording Audio


 
  Hi,
 
  I want to record audio from the emulator using the mic. Can anyone
  send me some sample code on how to do this.
  Also, I want to know whether it is possible to redirect this mic o/p
  to a memory buffer or network socket.
 
  Cheers,
  Earlence
 
  


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording Audio

2009-01-11 Thread hmmm
I'm using Windows and the only thing I did to the emulator was to emulate sd 
card as below. For some reason sd card seems to be necessary for sound 
recording.
Apart from that, provided that your mic works with Windows, there's no need to 
setup anything. I don't know about Ubuntu but it should be the same. 
- Original Message - 
  From: Lucius Fox 
  To: android-developers@googlegroups.com 
  Sent: Monday, January 12, 2009 9:11 AM
  Subject: [android-developers] Re: Recording Audio


  Thanks. how can I seutp the emulator to record audio?
  I am using Ubuntu as my development environment.  How can I setup the 
emulator for that?

  Thank you.


  On Sun, Jan 11, 2009 at 2:23 PM, hmmm akul...@mail.ru wrote:


To Record audio to a new file on sd card I did as follows and worked for me
with emulator and mic. But don't know about buffers or sockets. And not sure
if this is a good way but anyway works.
To run emulator with sd card you do mksdcard 512M sdimg.iso then start
emulator as 'emulator.exe -sdcard sdimg.iso'

private void startRecord() {

mRecorder = new MediaRecorder();

mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);

mRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);

mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);


mRecorder.setOutputFile(/sdcard/test.3gpp);

mRecorder.prepare();

mRecorder.start();

}

then elsewhere mRecorder.stop();

then to play

mPlayer = MediaPlayer.create(context, Uri.parse(mFilePath));

mPlayer.start();

Also I have

uses-permission android:name=android.permission.RECORD_AUDIO
/uses-permission




- Original Message -
From: Tez earlencefe...@gmail.com
To: Android Developers android-developers@googlegroups.com
Sent: Sunday, January 11, 2009 10:24 AM
Subject: [android-developers] Recording Audio



 Hi,

 I want to record audio from the emulator using the mic. Can anyone
 send me some sample code on how to do this.
 Also, I want to know whether it is possible to redirect this mic o/p
 to a memory buffer or network socket.

 Cheers,
 Earlence

 






  

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording audio stream

2008-12-30 Thread FranckLefevre


The application Phone Recorder available in Market softwares already
does this pretty well.
I don't know if sources are available somewhere...


Franck.



On Dec 25, 1:27 am, vitalii.mi...@gmail.com
vitalii.mi...@gmail.com wrote:
   Is there any way to record audio stream and send streaming audio  to
 network ??  Instead of recording to file.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Recording audio stream

2008-12-30 Thread Dave Sparks

It's probably not really streaming audio. Some people are working
around the issue by tailing the file as it is being written.

On Dec 30, 5:03 am, FranckLefevre flas...@gmail.com wrote:
 The application Phone Recorder available in Market softwares already
 does this pretty well.
 I don't know if sources are available somewhere...

 Franck.

 On Dec 25, 1:27 am, vitalii.mi...@gmail.com

 vitalii.mi...@gmail.com wrote:
Is there any way to record audio stream and send streaming audio  to
  network ??  Instead of recording to file.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---