[android-developers] Re: RTSP Example

2010-07-30 Thread Dave Sparks
That sounds like a problem with Hero. The compositor is supposed to
scale the video to fit the surface view.

On Jul 18, 6:41 am, Anthoni anthoni.gard...@gmail.com wrote:
 Hi Dave,

 Thanks, found that it partially works, but for some reason I think the
 videos are scaled wrong. On my hero I can only see half (width wise)
 the video. Noticed this on a few others I've tried as well, so not
 sure if it's a problem with the Hero or what :(

 Regards
 Anthoni

 On Jul 15, 9:59 pm, Dave Sparks davidspa...@android.com wrote:



  Try m.youtube.com, this works on other Android devices. I don't have a
  Hero to test with.

  On Jul 14, 12:18 pm, Anthoni anthoni.gard...@gmail.com wrote:

   Hello,

   I am trying to find a URL that conforms to the proper RTSP protocol
   that Android will understand. I've various ones and added them into
   the API demo from Google but every single time I get the error ERROR/
   PlayerDriver(37): Command PLAYER_INIT completed with an error or info
   PVMFFailure

   I am trying this on an actual device (after reading the emulator
   doesn't play videos at all). So I plugged in my HTC Hero, yet still
   the same.
   Can Android actually play RTSP streams or is it just some ridiculous
   myth ?

   What I am looking for is a live RTSP stream that I can view to
   validate that it does actually play. It doesn't have to be long, just
   a few seconds worth with audio and video would be great.
   It's proving impossible.

   Regards
   Anthoni

-- 
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: adding audio to a game - triggerClip for SFX

2010-07-30 Thread Dave Sparks
triggerClip() was designed to play synchronized sound effects for
musical games like JetBoy.

If you just want to play random sound effects, I would use SoundPool
instead.

On Jul 30, 5:53 am, kk kkostia...@gmail.com wrote:
 Hi all,

 I'm using JetPlayer in order to add some audio to a game I'm
 developing.
 Using the examples in JetBoy I have managed to create a .jet file
 using JetCreator and play an audio track.
 So far so good. However, I'm having some trouble playing sound effects
 for my game.

 I have a set of very small .mid files, each containing a shooting
 sound for a different weapon.
 However, when I try to add the .mid file in JetCreator I get
    The segment starting and ending times are illogical
 I'm guessing this is because the clip is too short and starting/ending
 M/B/T are both 1/1/0 ?

 The idea was to add these SFXs and then use triggerClip to play them.
 My question is, background music aside (I can make that work) what's
 the best way to add SFX in a game
 so that you can trigger them at any point programmaticaly? (i.e. have
 something like playShootingSFX1(),
 playShootingSFX2(), etc. that will go and play the SFX immediately).

 thx in advance,
 k.

-- 
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: 2.2 Camera Orientation Problem

2010-07-15 Thread Dave Sparks
See android.hardware.Camera.setDisplayOrientation (int degrees)

This is the approved way to set the camera orientation as of V2.2.
Please note that this only works for still images, videos will still
record in landscape orientation.

On Jul 15, 5:00 am, Vincent y.ikeda.asa...@gmail.com wrote:
 Hi,

 In my camera application, I use the following code to change the
 screen orientation.

 Parameters params = mCamera.getParameters();
 params.set(orientation, portrait);

 It worked for the most of devices.
 However, after updating my NexusOne to 2.2, the above code does not
 work!!
 Is there any other way to change the orientation?

 The only way to change the orientation is to change the orientation of
 an Activity.
 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
 But, I don't want to do this because I have other controls like Text
 or Button on Screen.

 If somebody knows the solution for this, please help me!!

-- 
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: RTSP Example

2010-07-15 Thread Dave Sparks
Try m.youtube.com, this works on other Android devices. I don't have a
Hero to test with.

On Jul 14, 12:18 pm, Anthoni anthoni.gard...@gmail.com wrote:
 Hello,

 I am trying to find a URL that conforms to the proper RTSP protocol
 that Android will understand. I've various ones and added them into
 the API demo from Google but every single time I get the error ERROR/
 PlayerDriver(37): Command PLAYER_INIT completed with an error or info
 PVMFFailure

 I am trying this on an actual device (after reading the emulator
 doesn't play videos at all). So I plugged in my HTC Hero, yet still
 the same.
 Can Android actually play RTSP streams or is it just some ridiculous
 myth ?

 What I am looking for is a live RTSP stream that I can view to
 validate that it does actually play. It doesn't have to be long, just
 a few seconds worth with audio and video would be great.
 It's proving impossible.

 Regards
 Anthoni

-- 
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: HTTP progressive streaming

2010-07-15 Thread Dave Sparks
Progressive streaming is like progressive download except that the
media file is partially cached in memory rather than writing to
permanent storage.

On Jul 13, 1:21 pm, Michel m.co...@nfb.ca wrote:
 On top of that my question is what is HTTP progressive streaming
 standing for?
 Is that a nick name for the traditionnal progressive download ..
  .. or something related to HTTP Live Streaming from Apple (for
 iPhone3/4 and iPad)
  .. or some other additional HTTP bitrate adaptative streaming just
 like the Apple,s one (Live Streaming) or the HTTP Smooth Streaming
 from Microsoft.

 An other way to ask the question is more simply: is HTTP progressive
 streaming a new way to stream based on HTTP (and though which one?)
 or different words to depict an already existing one (and which one as
 well?) ?

 Is there anyone aware of that at Google?

-- 
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: progressive video play over https

2010-07-15 Thread Dave Sparks
The media player currently does not support https.

On Jul 13, 7:18 pm, zhao zhaoyang...@gmail.com wrote:
 I am trying to stream video over https from Android browser. If the
 video url is http, everything works fine. But when I switch the url to
 https, no video can be played. I tried 2 methods to stream over http/
 https through Android browser.

 1. Use html5 Video tag on browser (Android 2.0+ device) and call
 video.play( ) from javascript.
 - With Https url. Browser launches media player and the player
 displays alert dialog saying “Can’t play video”. I captured the client
 TCP traffic and found no SSL handshake between client and server. It
 looks like the player pops up the alert on any https link.
 - With Http url. Browser launches media player and the player can
 stream the video successfully.

 2. Use direct link of html a tag on browser and click the link
 - With Https url. Browser downloads the video file without launching
 the player. The browser seems not try to load any https link in media
 player.
 - With Http url. Browser launches media player and the player can
 stream the video successfully.

 So the above tests make me think Android media player cannot play
 media from any https url. Is it the expected behavior? Can someone
 give me clues?

 Thanks for helping!

 Regards,
 Zhao

-- 
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: Android G1 - Streaming WMV

2009-05-22 Thread Dave Sparks

HTTP progressive and RTSP for 3GPP/MPEG-4 streams.

On May 22, 10:57 am, Emil semil...@gmail.com wrote:
 Thanks for the answer.

 So which video streaming formats the Android G1 does support?

 Emil

 On May 22, 4:39 am, Dave Sparks davidspa...@android.com wrote:

  The G1 does not support Windows Media streaming formats, only local
  file playback.

  On May 21, 1:23 am, semil103 semil...@gmail.com wrote:

   Hello,

   I would like to know if I can view streamed WMV video format using G1
   device (not the developer phone).
   I understand that WMV format is not included in basic Android
   Supported Media Formats. But I'm interested in developing application
   specific for G1 device. My hope is taken 
   from:http://developer.android.com/guide/appendix/media-formats.html
   Here It's written that
   In addition to the core media formats supported in the Android
   platform, the T-Mobile G1 also supports the formats listed below:
   .
   WMV Versions 7, 8 and 9. Simple profile only Windows Media Video
   (.wmv)

   I just can't find the answer for that question. can anyone help me
   clearing this issue so I would know if it is worthwhile to purchase G1
   device?

   Thanks,
   Emil
--~--~-~--~~~---~--~~
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: rtsp/http Streaming

2009-05-22 Thread Dave Sparks

This is supported, it definitely should not crash even if there's a
problem. Where's the stack trace for the crash?

On Apr 29, 8:30 am, Zhubham sahilz...@gmail.com wrote:
 Hi People,

 I need your help regarding streaming in android. I read some of the
 previous discussions but I have a few doubts which i thought of
 clarifying from you . Please help me with the following aspects:

 (i) Does android supports RTSP and HTTP streaming ??

 (ii) One discussion read - Streaming does not work in the emulator
 environment due to some firewall issues in the emulator network
 layer. Is this issue not resolved till now??

 (iii) I used the api demo code available @ \ApiDemos\src\com\example
 \android\apis\media\MediaPlayerDemo_Video.java

 Here I set the path as-  path = Rtsp://10.2.5.220/sample_50kbit.
 3gp;
 OR as - path = rtsp://10.2.5.220/sample_100kbit.mp4

 THIS IS CRASHING @ mMediaPlayer.prepare(); (I am using darwin
 streaming server)

 This is playing fine in local playback. But, I am not able to
 understand why it is crashing here. Please suggest.

 (iv) The supported codecs are MPEG4 Video, AVC, MPEG4 Audio, AMR, and
 H263. Am I correct??

 I await your response. Kindly assist.

 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: How to redirect audio to bluetooth headset?

2009-05-22 Thread Dave Sparks

I'm pretty sure that headset is SCO only. We don't support routing app
processor audio to SCO.

On May 22, 2:38 am, jianwei kevin@gmail.com wrote:
 Sorry for my poor english. May be you didn't understand my purpose.
 I'm a application developer for android platform, and i didn't know
 much about bluetooth. Our application will play some audioes(audio
 format is amr). When bluetooth headset is paired and connected, we
 need playing audio by bluetooth headset. Howerver audio is alway
 played by phone speaker, not bt headset.  My bt headset is HBH-631,
 made by SONY ERICSSON, and it's fine when i call phone. Any
 suggestions? Very thanks.

 On 5月22日, 上午9时36分, Dave Sparks davidspa...@android.com wrote:

  You asked specifically about Bluetooth SCO before. SCO is an 8KHz mono
  audio channel compressed down to a low bit-rate stream. To get a
  simulation of what it sounds like, try listening to music over a GSM
  circuit.

  Bluetooth A2DP is a different story. It use a reasonably good
  perceptual stereo codec. With the Cupcake 1.5 release, we support A2DP
  out of the box. If the user pairs and connects an A2DP headset, there
  is nothing the application has to do - it just works.

  On May 20, 6:46 pm, jianwei kevin@gmail.com wrote:

   Thanks for your responese.
   Does this mean all audio in thirdparty application can't play in
   bluetooth headset?

   Dave Sparks wrote:
We don't support sending app processor audio over SCO. The audio
quality would be very poor.

On May 20, 6:51 am, jianwei kevin@gmail.com wrote:
 Hi all,
 I met a problem of bluetooth headset. I want to switch audio playing
 to bluetooth headset when bluetooth headset is paired. I found
 BluetoothDevice in android sources which can controll bluetooth.
 However it is not contained in android.jar. So I used
 AudioManager.setBluetoothScoOn(true), but it still can't work. This
 problem has troubled me a long time. I do appreciate your help. 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: How to redirect audio to bluetooth headset?

2009-05-22 Thread Dave Sparks

With an A2DP headset, all app processor audio can be routed to the
headset.

I thought I gave a pretty good summary of the differences between SCO
and A2DP. If you need more detail, there is a lot of information
available on the web.

On May 22, 7:02 am, jianwei kevin@gmail.com wrote:
 What's SCO? What's A2DP? I'm not clear about that. Did that mean if i
 using A2DP bluetooth headset,   all audioes will auto play by
 bluetooth headset? And not all bluetooth headset hardware supports
 A2DP. Does that right?

 On 5月22日, 上午9时36分, Dave Sparks davidspa...@android.com wrote:

  You asked specifically aboutBluetoothSCO before. SCO is an 8KHz mono
  audio channel compressed down to a low bit-rate stream. To get a
  simulation of what it sounds like, try listening to music over a GSM
  circuit.

  BluetoothA2DP is a different story. It use a reasonably good
  perceptual stereo codec. With the Cupcake 1.5 release, we support A2DP
  out of the box. If the user pairs and connects an A2DPheadset, there
  is nothing the application has to do - it just works.

  On May 20, 6:46 pm, jianwei kevin@gmail.com wrote:

   Thanks for your responese.
   Does this mean all audio in thirdparty application can't play in
  bluetoothheadset?

   Dave Sparks wrote:
We don't support sending app processor audio over SCO. The audio
quality would be very poor.

On May 20, 6:51 am, jianwei kevin@gmail.com wrote:
 Hi all,
 I met a problem ofbluetoothheadset. I want to switch audio playing
 tobluetoothheadsetwhenbluetoothheadsetis paired. I found
 BluetoothDevice in android sources which can controllbluetooth.
 However it is not contained in android.jar. So I used
 AudioManager.setBluetoothScoOn(true), but it still can't work. This
 problem has troubled me a long time. I do appreciate your help. 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: play sound issue

2009-05-21 Thread Dave Sparks

I can't tell from your code snippet what you are trying to do.
However, I suggest you try using SoundPool. It's designed for this
kind of use.

On May 21, 12:53 am, Sukitha Udugamasooriya suk...@gmail.com wrote:
 Hi,

 In my application i'm playing a 1 second sound clip when the user
 clicks on a button. after that a mall thread sleep then i have
 assigned a small animation to the particular button. (500ms
 duration).
 Animation works fine without sound. But when I put sound the animation
 is not consistent.

 Why is that?

                 mp = MediaPlayer.create(this, R.raw.over);
                 try {
                         mp.prepare();
                 } catch (IOException e) {
                         Log.w(EXCEPTION, IO);
                         e.printStackTrace();
                 }

 Do i need to start sound on  a different thread?
 Is there anything to concern regarding this?

 Thanks for the help
--~--~-~--~~~---~--~~
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: How to redirect audio to bluetooth headset?

2009-05-21 Thread Dave Sparks

You asked specifically about Bluetooth SCO before. SCO is an 8KHz mono
audio channel compressed down to a low bit-rate stream. To get a
simulation of what it sounds like, try listening to music over a GSM
circuit.

Bluetooth A2DP is a different story. It use a reasonably good
perceptual stereo codec. With the Cupcake 1.5 release, we support A2DP
out of the box. If the user pairs and connects an A2DP headset, there
is nothing the application has to do - it just works.

On May 20, 6:46 pm, jianwei kevin@gmail.com wrote:
 Thanks for your responese.
 Does this mean all audio in thirdparty application can't play in
 bluetooth headset?

 Dave Sparks wrote:
  We don't support sending app processor audio over SCO. The audio
  quality would be very poor.

  On May 20, 6:51 am, jianwei kevin@gmail.com wrote:
   Hi all,
   I met a problem of bluetooth headset. I want to switch audio playing
   to bluetooth headset when bluetooth headset is paired. I found
   BluetoothDevice in android sources which can controll bluetooth.
   However it is not contained in android.jar. So I used
   AudioManager.setBluetoothScoOn(true), but it still can't work. This
   problem has troubled me a long time. I do appreciate your help. 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: Android G1 - Streaming WMV

2009-05-21 Thread Dave Sparks

The G1 does not support Windows Media streaming formats, only local
file playback.

On May 21, 1:23 am, semil103 semil...@gmail.com wrote:
 Hello,

 I would like to know if I can view streamed WMV video format using G1
 device (not the developer phone).
 I understand that WMV format is not included in basic Android
 Supported Media Formats. But I'm interested in developing application
 specific for G1 device. My hope is taken 
 from:http://developer.android.com/guide/appendix/media-formats.html
 Here It's written that
 In addition to the core media formats supported in the Android
 platform, the T-Mobile G1 also supports the formats listed below:
 .
 WMV Versions 7, 8 and 9. Simple profile only Windows Media Video
 (.wmv)

 I just can't find the answer for that question. can anyone help me
 clearing this issue so I would know if it is worthwhile to purchase G1
 device?

 Thanks,
 Emil
--~--~-~--~~~---~--~~
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: How to redirect audio to bluetooth headset?

2009-05-20 Thread Dave Sparks

We don't support sending app processor audio over SCO. The audio
quality would be very poor.

On May 20, 6:51 am, jianwei kevin@gmail.com wrote:
 Hi all,
 I met a problem of bluetooth headset. I want to switch audio playing
 to bluetooth headset when bluetooth headset is paired. I found
 BluetoothDevice in android sources which can controll bluetooth.
 However it is not contained in android.jar. So I used
 AudioManager.setBluetoothScoOn(true), but it still can't work. This
 problem has troubled me a long time. I do appreciate your help. 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: How to detect if sound is currently playing on the speaker?

2009-05-19 Thread Dave Sparks

No, there is no API for this.

On May 18, 12:56 pm, Flying Coder av8r.st...@gmail.com wrote:
 Hi,
     Is there any way to tell if an app is currently using the speaker
 (playing music or generating other sounds)?  Specifically, I'd like to
 detect if an alarm clock is going off (not only the one that comes
 with the system, but any alarm clock), but I'll settle for simply
 knowing if any sounds are coming out of the speaker.

     Any thoughts?

 Thanks!
 Steve
--~--~-~--~~~---~--~~
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: Could Android play RGB 24-bit color depth format video?

2009-05-19 Thread Dave Sparks

This is a hardware-dependent feature. Frankly, I don't see any value
in it because the display devices don't have 24-bit support.

On May 19, 4:57 am, Edware littlenew1...@gmail.com wrote:
 Dear Sir,
 As I know, Android only supports RGB 16-bit color depth format. Could
 Android play 24-bit color RGB format video and REALLY see 24-bit color
 now? If it is not, will it be supported by Android Donut in the future?
--~--~-~--~~~---~--~~
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: Using the AudioRecord API

2009-05-19 Thread Dave Sparks

You probably don't need the callback interface. The read() will block
until the buffer is full.

If you are getting buffer overflows, you are probably spending too
much time in your doSomething() call.

On May 19, 11:59 am, benmccann benjamin.j.mcc...@gmail.com wrote:
 Thanks for the response.  I'm still foggy on the API usage though.  I
 basically want to listen to the mic and continually process the
 incoming audio.  Should I be using the OnRecordPositionUpdateListener
 at all?

 Or should it look something like:
 recorder.startRecording()
 while(recorder.read(buffer)  0) {
   doSomething(buffer)

 }

 When I've done the latter I get buffer overflow exceptions.

 On May 15, 3:51 pm, Dave Sparks davidspa...@android.com wrote:

  You need to call the read() method.

  On May 15, 3:15 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

   Any ideas?

   Thanks,
   Ben

   On May 15, 1:02 am, benmccann benjamin.j.mcc...@gmail.com wrote:

Hi,
I'm trying to figure out how to use theAudioRecordclass.  I created
a callback with a logging message, but don't ever see it called.  Do
you see anything wrong with what I'm doing?  Do you have an example of
how to use the API?

Thanks,
Ben

import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.util.Log;

public class AudioListener {

  public static final int DEFAULT_SAMPLE_RATE = 8000;
  private static final int DEFAULT_BUFFER_SIZE = 4096;
  private static final int CALLBACK_PERIOD = 4000;  // 500 msec
(sample rate / callback period)
  private finalAudioRecordrecorder;

  public AudioListener() {
    this(DEFAULT_SAMPLE_RATE);
  }

  private AudioListener(int sampleRate) {
    recorder = newAudioRecord(MediaRecorder.AudioSource.DEFAULT,
        sampleRate, AudioFormat.CHANNEL_CONFIGURATION_DEFAULT,
        AudioFormat.ENCODING_DEFAULT, DEFAULT_BUFFER_SIZE);
  }

  public void start() {
    recorder.setPositionNotificationPeriod(CALLBACK_PERIOD);
    
recorder.setRecordPositionUpdateListener(newAudioRecord.OnRecordPositionUpdateListener()
 {
      @Override
      public void onMarkerReached(AudioRecordrecorder) {
        Log.e(this.getClass().getSimpleName(), onMarkerReached
Called);
      }

      @Override
      public void onPeriodicNotification(AudioRecordrecorder) {
        Log.e(this.getClass().getSimpleName(), onPeriodicNotification
Called);
      }
    });

    recorder.startRecording();
  }

}
--~--~-~--~~~---~--~~
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: Using the AudioRecord API

2009-05-15 Thread Dave Sparks

You need to call the read() method.

On May 15, 3:15 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
 Any ideas?

 Thanks,
 Ben

 On May 15, 1:02 am, benmccann benjamin.j.mcc...@gmail.com wrote:

  Hi,
  I'm trying to figure out how to use theAudioRecordclass.  I created
  a callback with a logging message, but don't ever see it called.  Do
  you see anything wrong with what I'm doing?  Do you have an example of
  how to use the API?

  Thanks,
  Ben

  import android.media.AudioFormat;
  import android.media.AudioRecord;
  import android.media.MediaRecorder;
  import android.util.Log;

  public class AudioListener {

    public static final int DEFAULT_SAMPLE_RATE = 8000;
    private static final int DEFAULT_BUFFER_SIZE = 4096;
    private static final int CALLBACK_PERIOD = 4000;  // 500 msec
  (sample rate / callback period)
    private finalAudioRecordrecorder;

    public AudioListener() {
      this(DEFAULT_SAMPLE_RATE);
    }

    private AudioListener(int sampleRate) {
      recorder = newAudioRecord(MediaRecorder.AudioSource.DEFAULT,
          sampleRate, AudioFormat.CHANNEL_CONFIGURATION_DEFAULT,
          AudioFormat.ENCODING_DEFAULT, DEFAULT_BUFFER_SIZE);
    }

    public void start() {
      recorder.setPositionNotificationPeriod(CALLBACK_PERIOD);
      
  recorder.setRecordPositionUpdateListener(newAudioRecord.OnRecordPositionUpdateListener()
   {
        @Override
        public void onMarkerReached(AudioRecordrecorder) {
          Log.e(this.getClass().getSimpleName(), onMarkerReached
  Called);
        }

        @Override
        public void onPeriodicNotification(AudioRecordrecorder) {
          Log.e(this.getClass().getSimpleName(), onPeriodicNotification
  Called);
        }
      });

      recorder.startRecording();
    }

  }
--~--~-~--~~~---~--~~
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: Video streaming error in SDK 1.5

2009-05-07 Thread Dave Sparks

You need to format the mp4 file for streaming. This means that the
moov atom must precede the mdat atom in the file.

On May 7, 5:05 am, N V nithi...@gmail.com wrote:
 Hi to all...

          I tried for video streaming in sdk 1.5... The video
 format .mp4... But it gives error
 like This video is not valid for streaming to this video. But 
 inhttp://developer.android.com/sdk/android-1.5-highlights.html.mp4 is
 supported for streaming

 Thank You
 Nithin N V
--~--~-~--~~~---~--~~
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: How to use AudioRecord and AudioTrack

2009-05-07 Thread Dave Sparks

The mic on all current Android devices, why would you want to record
stereo?

On May 7, 3:43 am, l hx lihongxia8...@gmail.com wrote:
 can we using channels 2 when recording audio?

 On Sat, May 2, 2009 at 12:54 AM, Jean-Michel jmtr...@gmail.com wrote:

  Hi there,
  Looks like sipdroid (www.sipdroid.org) is using AudioTrack and
  AudioRecord for their SIP client. Go to the Browse source page and
  look at trunk  src  org  sipdroid  media  RtpStreamReceiver.java
  and RtpStreamSender.java, and search respectively for track and
  record.

  On Apr 30, 7:07 am, Thomson thomsont...@gmail.com wrote:
   Hi,
          I want to use AudioRecord and AudioTrack classes(in SDK 1.5) in
   my program.
   Where can I find how to use it. Is there any API demo program for
   this?.
   If not it is greatly appreciated if someone can post a sample code in
   this forum

   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: Video with MediaRecorder

2009-05-07 Thread Dave Sparks

This is a limitation of the hardware, the preview size and encoded
size must be the same.

I'm not sure how you were able to change the preview size though. I'd
like to know the code sequence you used, because it's not supposed to
be possible.

On May 6, 11:11 am, Jason Proctor ja...@particularplace.com wrote:
 just a tiny fyi here is that i did manage to get video recording
 working fine in my app.

 there is however a problem if the surface view fills its parent and
 the parent is the entire screen. if that happens, then the camera's
 view of things gets resized but nobody tells the codec, and hence the
 movie is messed up. it's encoded for one size but the movie metainfo
 says something else.

 making the size something smaller than the screen made it work, but
 it *is* a bug IMHO.

 --
 jason.software.particle
--~--~-~--~~~---~--~~
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: Video with MediaRecorder

2009-05-07 Thread Dave Sparks

Wait, when you say corruption, you really mean that there's a mismatch
between the metadata and the actual frame size, is that correct?

On May 7, 11:17 am, Jason Proctor ja...@particularplace.com wrote:
 i don't change it, it gets changed by the Author Driver presumably
 to avoid colliding with the status bar or somesuch.

 here's some log output which might illustrate what's going on --

 05-07 11:13:51.516: WARN/AuthorDriver(35): Intended width(480)
 exceeds the max allowed width(352). Max width is used instead. 05-07
 11:13:51.516: WARN/AuthorDriver(35): Intended height(295) exceeds the
 max allowed height(288). Max height is used instead.
 however, a bit later on it seems that nobody has told the camera this --

 05-07 11:13:51.686: VERBOSE/QualcommCameraHardware(35): requested
 size 480 x 320 05-07 11:13:51.686:
 VERBOSE/QualcommCameraHardware(35): actual size 480 x 320
 so the codec is encoding for 480x320, but the surface is only
 delivering 352x288. hence the corruption.

 hth
 j



 This is a limitation of the hardware, the preview size and encoded
 size must be the same.

 I'm not sure how you were able to change the preview size though. I'd
 like to know the code sequence you used, because it's not supposed to
 be possible.

 On May 6, 11:11 am, Jason Proctor ja...@particularplace.com wrote:
   just a tiny fyi here is that i did manage to get video recording
   working fine in my app.

   there is however a problem if the surface view fills its parent and
   the parent is the entire screen. if that happens, then the camera's
   view of things gets resized but nobody tells the codec, and hence the
   movie is messed up. it's encoded for one size but the movie metainfo
   says something else.

   making the size something smaller than the screen made it work, but
   it *is* a bug IMHO.

   --
   jason.software.particle

 --
 jason.software.particle
--~--~-~--~~~---~--~~
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: Video with MediaRecorder

2009-05-06 Thread Dave Sparks

You need to call setPreviewDisplay() and pass in a SurfaceView before
you call prepare().

On May 6, 8:45 am, Anders Nilsson Plymoth lanils...@gmail.com wrote:
 Hi,

 Does anyone know how to use the MediaRecorder to API to capture video?

 I am writing an application where I want to be able to capture video. I am
 trying to use the MediaRecorder API in 1.5, which is supposed to support
 video capture. However, there are no examples in the documentation on how to
 use this API for video (only for audio, and that works perfect). Basically
 what I do is the following:

 final MediaRecorder recorder = new MediaRecorder();
 final String filePath;

 

 recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
 recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
 recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
 recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
 recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
 recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
 recorder.setOutputFile(filePath);
 recorder.prepare();
 recorder.start();

 This gives me the following error:
 E/CameraInput(   37): No surface is available for display
 E/MediaRecorder( 7609): prepare failed: -2147483648

 OK, so I have to have a surface to preview the video? Could be useful I
 guess, but not something I really need.

 Could I use the VideoView widget for this, or is that only for playback?

 Or am I supposed to use a SurfaceView to preview the video? I saw someone
 use that to capture images, but they used android.hardware.Camera to open
 the camera and capture a frame, and did not use MediaRecorder.

 Does anyone have any idea on how to capture video, or even better have some
 example code?

 Thanks,
 Anders
--~--~-~--~~~---~--~~
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: Google voice recognition on Emulator

2009-05-04 Thread Dave Sparks

This intent is handled by the Google Voice Search application. Do you
have it installed?

On May 4, 6:12 am, Yash Patel yashjpa...@gmail.com wrote:
 Hi Dave

 Here is the error i am getting.

 android.content.ActivityNotFoundException: No Activity found to handle
 Intent { action=android.speech.action.RECOGNIZE_SPEECH (has extras) }

 and here is the code sample that i am using for Sppech recognize in
 emulator.

 OnClickListener mTabButton = new OnClickListener() {
         public void onClick(View v) {

             try
             {
                  ArrayListString potentialResults = new
 ArrayListString();
                  potentialResults.add(yellow);
                  potentialResults.add(green);
                  potentialResults.add(blue);
                  potentialResults.add(red);

                  // Create Intent
                  Intent intent = new
 Intent(android.speech.action.RECOGNIZE_SPEECH);

                  // Settings
                  intent.putExtra(android.speech.extra.LANGUAGE_MODEL,
 free_form);
                  intent.putExtra(android.speech.extra.PROMPT, Speak
 now);
                  intent.putExtra(android.speech.extra.RESULTS,
 potentialResults);

                  // Start the Recognition Activity
                  startActivityForResult(intent, RESULT_SPEECH);
             }
             catch(Exception ex) {
                 ex.printStackTrace();
             }

         }

 On Fri, May 1, 2009 at 9:23 PM, Dave Sparks davidspa...@android.com wrote:

  What is the error?

  On May 1, 5:18 pm, Yash Patel yashjpa...@gmail.com wrote:
    I mean to say Speech Recognization. I tried to create one small
  application
   but it gives me error.

   Thanks
   Yash Patel

   On Fri, May 1, 2009 at 4:54 PM, Dave Sparks davidspa...@android.com
  wrote:

Voice recognition is a technology. You need an application to make use
of it, for example the voice dialer.

On May 1, 11:17 am, Yash Patel yashjpa...@gmail.com wrote:
 HI,

 does any one know How to  turn on Voice Recognition on Emulator. or
  is it
 required to have phone or dev phone to test voice recognition
application?

 I would appreciate if you can reply.

 thanks
 Yash Patel
--~--~-~--~~~---~--~~
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: Google voice recognition on Emulator

2009-05-04 Thread Dave Sparks

Google Voice Search is a Google application, not part of the Android
platform. It will only be present on devices that have a Google
license agreement.

However, because it uses the intent system, it is possible for someone
else to provide competing solution.

On May 4, 2:12 pm, qvark joseluishuertasfernan...@gmail.com wrote:
 Hi Dave, I don't understand this very well... does it mean that speech
 recognition is not part of the platform but provided by a Google app?

 Can we expect it to be present in every device with Android 1.5? Is
 the Google Voice Search application always needed even if we are not
 using speech recognition to perform web searches?

 Thanks,

 Jose Luis.

 On 4 mayo, 20:46, Dave Sparks davidspa...@android.com wrote:

  This intent is handled by the Google Voice Search application. Do you
  have it installed?

  On May 4, 6:12 am, Yash Patel yashjpa...@gmail.com wrote:

   Hi Dave

   Here is the error i am getting.

   android.content.ActivityNotFoundException: No Activity found to handle
   Intent { action=android.speech.action.RECOGNIZE_SPEECH (has extras) }

   and here is the code sample that i am using for Sppech recognize in
   emulator.

   OnClickListener mTabButton = new OnClickListener() {
           public void onClick(View v) {

               try
               {
                    ArrayListString potentialResults = new
   ArrayListString();
                    potentialResults.add(yellow);
                    potentialResults.add(green);
                    potentialResults.add(blue);
                    potentialResults.add(red);

                    // Create Intent
                    Intent intent = new
   Intent(android.speech.action.RECOGNIZE_SPEECH);

                    // Settings
                    intent.putExtra(android.speech.extra.LANGUAGE_MODEL,
   free_form);
                    intent.putExtra(android.speech.extra.PROMPT, Speak
   now);
                    intent.putExtra(android.speech.extra.RESULTS,
   potentialResults);

                    // Start the Recognition Activity
                    startActivityForResult(intent, RESULT_SPEECH);
               }
               catch(Exception ex) {
                   ex.printStackTrace();
               }

           }

   On Fri, May 1, 2009 at 9:23 PM, Dave Sparks davidspa...@android.com 
   wrote:

What is the error?

On May 1, 5:18 pm, Yash Patel yashjpa...@gmail.com wrote:
  I mean to say Speech Recognization. I tried to create one small
application
 but it gives me error.

 Thanks
 Yash Patel

 On Fri, May 1, 2009 at 4:54 PM, Dave Sparks davidspa...@android.com
wrote:

  Voice recognition is a technology. You need an application to make 
  use
  of it, for example the voice dialer.

  On May 1, 11:17 am, Yash Patel yashjpa...@gmail.com wrote:
   HI,

   does any one know How to  turn on Voice Recognition on Emulator. 
   or
is it
   required to have phone or dev phone to test voice recognition
  application?

   I would appreciate if you can reply.

   thanks
   Yash Patel
--~--~-~--~~~---~--~~
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: Camera still regularly hangs with Cupcake, requiring power cycle

2009-05-01 Thread Dave Sparks

Can you repro this with the camera application?


On May 1, 6:22 am, blindfold seeingwithso...@gmail.com wrote:
 I found that the old bug reported 
 inhttp://code.google.com/p/android/issues/detail?id=1578
 where only a power cycle brings back the camera still persists with
 the official Cupcake firmware on my ADP. When it happens - and I've
 encountered it several times in a few days now - no camera application
 can access the camera. A power cycle is needed to recover from this
 locked camera state.

 Regards
--~--~-~--~~~---~--~~
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: Camera still regularly hangs with Cupcake, requiring power cycle

2009-05-01 Thread Dave Sparks

Are you using the camera unlock() method? There is a known issue where
if the application calls unlock() and then exits for any reason, it
can leave the camera service in a state where it will reject any
subsequent attempts to reconnect.

On May 1, 12:57 pm, blindfold seeingwithso...@gmail.com wrote:
 Once the camera is in this state, Cupcake's built-in camera app gives
 in LogCat

 05-01 21:48:03.941: DEBUG/CameraService(35): Connect E from
 ICameraClient 0x46290
 05-01 21:48:03.951: DEBUG/CameraService(35): new client (0x46290)
 attempting to connect - rejected
 05-01 21:48:03.951: WARN/dalvikvm(1480): threadid=15: thread exiting
 with uncaught exception (group=0x4000fe70)
 05-01 21:48:03.951: ERROR/AndroidRuntime(1480): Uncaught handler:
 thread Thread-8 exiting due to uncaught exception
 05-01 21:48:03.951: ERROR/AndroidRuntime(1480):
 java.lang.RuntimeException: Out of memory
 05-01 21:48:03.951: ERROR/AndroidRuntime(1480):     at
 android.hardware.Camera.native_setup(Native Method)
 05-01 21:48:03.951: ERROR/AndroidRuntime(1480):     at
 android.hardware.Camera.init(Camera.java:82)
 05-01 21:48:03.951: ERROR/AndroidRuntime(1480):     at
 android.hardware.Camera.open(Camera.java:64)
 05-01 21:48:03.951: ERROR/AndroidRuntime(1480):     at
 com.android.camera.Camera$2.run(Camera.java:659)
 05-01 21:48:03.951: ERROR/AndroidRuntime(1480):     at
 java.lang.Thread.run(Thread.java:1058)

 My own app in this state also gives

 05-01 21:51:57.051: DEBUG/CameraService(35): Connect E from
 ICameraClient 0x467e8
 05-01 21:51:57.051: DEBUG/CameraService(35): new client (0x467e8)
 attempting to connect - rejected

 but without the java.lang.RuntimeException: Out of memory

 I must then reboot the phone to get the camera back. I'm currently
 investigating if my use of Proguard perhaps has anything to do with
 it, because things seem stable until I prepare a release APK.

 Regards

 On May 1, 5:00 pm, Dave Sparks davidspa...@android.com wrote:

  Can you repro this with the camera application?

  On May 1, 6:22 am, blindfold seeingwithso...@gmail.com wrote:

   I found that the old bug reported 
   inhttp://code.google.com/p/android/issues/detail?id=1578
   where only a power cycle brings back the camera still persists with
   the official Cupcake firmware on my ADP. When it happens - and I've
   encountered it several times in a few days now - no camera application
   can access the camera. A power cycle is needed to recover from this
   locked camera state.

   Regards
--~--~-~--~~~---~--~~
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: Google voice recognition on Emulator

2009-05-01 Thread Dave Sparks

Voice recognition is a technology. You need an application to make use
of it, for example the voice dialer.

On May 1, 11:17 am, Yash Patel yashjpa...@gmail.com wrote:
 HI,

 does any one know How to  turn on Voice Recognition on Emulator. or is it
 required to have phone or dev phone to test voice recognition application?

 I would appreciate if you can reply.

 thanks
 Yash Patel
--~--~-~--~~~---~--~~
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: video recording in 1.5

2009-05-01 Thread Dave Sparks

Did you include android.permission.CAMERA in your manifest?

On May 1, 3:21 pm, Jason Proctor juvat...@gmail.com wrote:
 (resend from different address, see if it makes it this time.)

 is video recording supported in 1.5?

 i got it mostly working with the Haykuro 1.5 ADP image - the video
 file was legally formatted but didn't play properly.

 with the official 1.5 images, it doesn't work at all.
 setVideoEncoder() fails, with the wonderfully informative error
 message setVideoEncoder failed.

 thanks for a position on this,
 Jason
--~--~-~--~~~---~--~~
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: Google voice recognition on Emulator

2009-05-01 Thread Dave Sparks

What is the error?

On May 1, 5:18 pm, Yash Patel yashjpa...@gmail.com wrote:
  I mean to say Speech Recognization. I tried to create one small application
 but it gives me error.

 Thanks
 Yash Patel

 On Fri, May 1, 2009 at 4:54 PM, Dave Sparks davidspa...@android.com wrote:

  Voice recognition is a technology. You need an application to make use
  of it, for example the voice dialer.

  On May 1, 11:17 am, Yash Patel yashjpa...@gmail.com wrote:
   HI,

   does any one know How to  turn on Voice Recognition on Emulator. or is it
   required to have phone or dev phone to test voice recognition
  application?

   I would appreciate if you can reply.

   thanks
   Yash Patel
--~--~-~--~~~---~--~~
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: video recording in 1.5

2009-05-01 Thread Dave Sparks

No, you have always needed a camera permission to access the camera.
It's new to the MediaRecorder API because we didn't add video support
until 1.5.

On May 1, 3:59 pm, Jason Proctor juvat...@gmail.com wrote:
 nope, never needed it. is the requirement new?

 i'll give it a go, thanks.

 (looks like my posts are going to the list then. does the list not
 echo them back to the poster, like it used to?)

 Did you include android.permission.CAMERA in your manifest?

 On May 1, 3:21 pm, Jason Proctor juvat...@gmail.com wrote:
   (resend from different address, see if it makes it this time.)

   is video recording supported in 1.5?

   i got it mostly working with the Haykuro 1.5 ADP image - the video
   file was legally formatted but didn't play properly.

   with the official 1.5 images, it doesn't work at all.
   setVideoEncoder() fails, with the wonderfully informative error
   message setVideoEncoder failed.

   thanks for a position on this,
   Jason
--~--~-~--~~~---~--~~
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: SurfaceView on G1

2009-04-30 Thread Dave Sparks

Do you have a stack trace from the log?

On Apr 30, 4:51 pm, petunio juanjosegilmen...@hotmail.com wrote:
 Hi

 I am finally testing my application on a G1 and even though it works
 fine on the emulator, it crashes on the G1

 it crashes when it does:
 setContentView(R.layout.mylayout);

 the xml is fairly simple:
                 com.google.android.myproject.myView
                         android:id=@+id/testid
                         android:layout_width=fill_parent
                         android:layout_height=fill_parent
                 /com.google.android.babel.myView

 and the view is defined like this:

 public class myView extends SurfaceView implements
 SurfaceHolder.Callback
 {

 }

 Has anybody found a similar problem?

 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: Video play error

2009-04-30 Thread Dave Sparks

Android does not support playing two video streams at the same time.

On Apr 30, 1:48 am, N V nithi...@gmail.com wrote:
 Hi to all

      I am playing 2 videos(.mpg4) at time... Some times its works
 fine, But some times give
 error like Cannot Play the Video Can any One tell me Why its
 Happens...?

 Thank You
 Nithin N V
--~--~-~--~~~---~--~~
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: Android 1.5: How can I play HE-AAC file type with MediaPlayer?

2009-04-28 Thread Dave Sparks

Encode in an mp4 or m4a file.

On Apr 28, 12:35 pm, Moto medicalsou...@gmail.com wrote:
 Could I somehow trick the player on playing something of this format?
 I know that there is support for AAC encoded files but just how?

 Thanks!
 Moto!
--~--~-~--~~~---~--~~
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: audio codec

2009-04-28 Thread Dave Sparks

AudioRecord gives you access to 16-bit PCM audio from the microphone
and AudioTrack gives you a way to output 16-bit PCM audio to the
output device.

On Apr 28, 8:50 am, intbt tacbe...@gmail.com wrote:
 Thanks, I think AudioTrack may be what I am looking for to read the
 codec output???

 http://developer.android.com/reference/android/media/AudioTrack.html

 On Apr 27, 6:11 pm, benmccann benjamin.j.mcc...@gmail.com wrote:

  The 1.5 SDK includes Raw audio recording and playback APIs.  I think
  I'd take a look 
  athttp://developer.android.com/reference/android/media/AudioRecord.html
  I'm not real sure how AudioRecord and MediaRecorder work together, if
  at all.  It looks like maybe AudioRecord is closer to the native calls
  while MediaRecorder wraps AudioRecord to provide a slightly friendlier
  interface and additonal encoding.  It's hard to tell from the JavaDocs
  alone.
  Here's a post talking about AudioRecord 
  instantiation:http://groups.google.com/group/android-developers/browse_thread/threa...

  On Apr 27, 5:23 pm, intbt tacbe...@gmail.com wrote:

   Is there a method to access the digital output of the audio codec
   without first storing it into a file, a streaming output?

   intbt
--~--~-~--~~~---~--~~
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: Playing sound from memory

2009-04-28 Thread Dave Sparks

SoundPool has too much jitter for a serious music application. If you
want to control the jitter, you need to output to a single AudioTrack.

On Apr 28, 8:27 am, Marco Nelissen marc...@android.com wrote:
 On Mon, Apr 27, 2009 at 5:50 PM, rookie1_1998
 eric.yongjun.c...@gmail.comwrote:



  I need a way to play a short sound clip repeatedly very fast, with
  precise timing for musical purpose.  I looked around, and it seems
  like MediaPlayer and SoundPool don't guarantee lag-free playing.  Is
  there anyway I could load the sound to memory myself and play from
  memory (edit the stream)?

 That's what SoundPool does: it loads the sound in to memory.
 If you really want to copy the bytes yourself, then you should use
 AudioTrack.
--~--~-~--~~~---~--~~
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: MediaPlayer.start() doesnot work fine after calling MediaPlayer.seekTo(0)

2009-04-27 Thread Dave Sparks

Try this:

mp.prepare();
mp.seekTo(0);
mp.start();

And get rid of your onPreparedListener. It is unnecessary since you
are calling prepare().

On Apr 27, 1:20 am, Sudha sudhaker...@gmail.com wrote:
 Hi,

 I have a requirement to play several sounds many times in my game so
 instead of creating the MediaPlayer again and again I have called
 mp.seekTo(0) in onCompletion(mp) so that it will restart.
 Sometimes the sound is not audible from the device when I call mp.start
 () after setting mp.seekTo(0); but the player calls onCompletion()
 without playing any sound, this is observed randomly on most of the
 sounds

 FYI:

   -  My sounds are of short duration mostly less than a second.
   -  I am using a separate MediaPlayer for each sound (as I need this)
   -  There are almost 28 sounds in my game so i will be creating 28
 MediaPlayers.
   -  Below is the attached code for player

 Also If I try to play many sounds one after the other in a short
 period of time i get an error saying no more track names available.
 can u tell Why this is happening...?

 check the below code:

 public boolean isPlayingSound; //class member
 MediaPlayer mp = null;
 String last_req = ;
 public void playSound(final String res) {
         if (isPlayingSound){
                 return;
         }
         try {

                 if (last_req.equals(res))
                 {
                         System.out.println(starting again: 
 +res); //
 Sudhaker
                         mp.start();
                         isPlayingSound = true;
                         return;
                 }
                 last_req = res;
                 mp = new MediaPlayer();

                 FileInputStream fIn = Utils.getContext().openFileInput(res);
                 if (fIn != null)
                 {
                         //we tell the mediaplayer which file he needs to 
 play. notice we
 don't tell him if this is a MIDI, WAV, MP3 or even AVI for that
 matter.
                         //why? he is smart enough to recognize them!! we 
 don't even have to
 use valid extensions like say .mid, .mp3, .wav!!! ... WOAH!! =D
                         mp.setDataSource(fIn.getFD());
                         fIn.close();
                 }

                 mp.setOnPreparedListener(new
                 MediaPlayer.OnPreparedListener() {
                         public void onPrepared(MediaPlayer mp)
                         {
                                 mp.start();
                                 isPlayingSound = true;
                         }
                 });

                 mp.setOnCompletionListener(new
                 MediaPlayer.OnCompletionListener() {
                         public void onCompletion(MediaPlayer mp)
                         {
                                 System.out.println(sound playing finished : 
 +res +  and seek to
 start); //Sudhaker
                                 //mp.release();
                                 mp.seekTo(0);
                                 isPlayingSound = false;
                         }
                 });

                 mp.setOnErrorListener(new
                 MediaPlayer.OnErrorListener() {
                         public boolean onError(MediaPlayer mp, int what, int 
 extra)
                         {
                                 mp.release();
                                 mp = null;
                                 deleteSoundFile(res);
                                 isPlayingSound = false;
                                 last_req=;
                                 return false;
                         }
                 });

                 // mp.prepareAsync();
                 if (isLooping())
                 {
                         mp.setLooping(true);
                 }
                 mp.prepare();

         } catch (Exception e) {
                 mp.release();
                 deleteSoundFile(res);
                 isPlayingSound = false;
                 mp = null;
                 new PlayerImpl(fileName,fileInputStream);
                 last_req=;
                 playSound(fileName);
         }

 }

 please reply asap...
--~--~-~--~~~---~--~~
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: Error playing YouTube video in my application

2009-04-27 Thread Dave Sparks

I assume this in the emulator. I believe the issue is that the
emulator does not forward the UDP packets you need for the RTP
session. This should work on a real device.

On Apr 27, 12:28 am, awwa awwa...@gmail.com wrote:
 I'm trying to play streaming video(*.3gp) with android SDK 1.5 pre.
 I have customized the APIDemo - VideoViewDemo.java.
 Specify the path to the URL of rtsp.
 I got the URL from the following URL.
 --http://gdata.youtube.com/feeds/api/videos?vq=8ZsML4uWoiw
 I used the following URL(*.3gp)
 --
 path = rtsp://rtsp2.youtube.com/
 CiILENy73wIaGQksopaLLwyb8RMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp

 But following error has occur.
 Please help me what is happen.

 
 04-27 07:10:24.238: WARN/ActivityManager(587): Launch timeout has
 expired, giving up wake lock!
 04-27 07:10:24.265: WARN/ActivityManager(587): Activity idle timeout
 for HistoryRecord{43603ba0 {com.example.android.apis/
 com.example.android.apis.media.VideoViewDemo}}
 04-27 07:10:27.975: ERROR/PlayerDriver(972): HandleInformationalEvent:
 type=28 UNHANDLED
 04-27 07:10:28.584: WARN/PlayerDriver(972): Using generic video MIO
 04-27 07:10:44.975: ERROR/PlayerDriver(972): Command PLAYER_PREPARE
 completed with an error or info PVMFFailure
 04-27 07:10:44.985: ERROR/MediaPlayer(1095): error (1, -1)
 04-27 07:10:44.995: ERROR/MediaPlayer(1095): Error (1,-1)
 04-27 07:10:45.515: WARN/PlayerDriver(972):
 PVMFInfoErrorHandlingComplete
 

 I have confirmed the local *.3gp file is enable to play with this
 code.
 path = /sdcard/747.3gp
--~--~-~--~~~---~--~~
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: AudioRecord can't get any notification when record/marker position updated

2009-04-27 Thread Dave Sparks

OK, so it sounds like audio is being produced by the kernel driver.

I just looked at your code, and I think you need to call read() once
to pass in your first input buffer.

On Apr 24, 6:04 pm, Steven_T gwb...@126.com wrote:
 hi Dave Sparks:
 thank you for reply!

 I didn't disable audio input in avd
 what you means is use option -audio backend to set an audio input

 I had used the next code test audio input
 //
 
 Intent intent = new Intent
 (MediaStore.Audio.Media.RECORD_SOUND_ACTION);
 startActivityForResult(intent, ACTIVITY_RECORD_SOUND);
 /
 =
 it can recording and saved audio as a file named recording47845.3gpp
 in sdcard

 the next is logcat out put:
 ===
 tag: AudioHardware
 Message: AudioStreamInGeneric::read(0x40715b40, 320) from fd 7

 tag:AudioFlinger
 Message: AudioRecordThread: buffer overflow

 tag: InputMangerServic
 Message: Starting input on non-focused client
 com.android.internal.view.iinputmethodclient$stub$pr...@4360c470
 (uid=100118 pid=764)
 

 Please help me, thanks!

 On Apr 25, 4:44 am, Dave Sparks davidspa...@android.com wrote:

  Did you enable audio input in the emulator?

  On Apr 23, 6:48 pm, Steven_T gwb...@126.com wrote:

   hi Dave Sparks:
      I have changed 50 frames to 400 frmaes, it doesn't work.
      then I set bufferSizeInBytes to 100 to init AudioRecord object,
   and set update period to 400,
      it dosn't work too. I had used logcat to watch emulator'log, didn't
   find this program pid throwed error,
      Can you give me sample?
      thanks

   On Apr 24, 1:10 am, Dave Sparks davidspa...@android.com wrote:

I suspect the problem is the interval you chose: 50 frames @ 8KHz is
6.25 msecs. Your app is not going to be able to handle a callback
every 6.25 msecs. Try something more reasonable like 50 msecs (400
frames) and see if that works.

On Apr 23, 1:56 am, Steven_T gwb...@126.com wrote:

 hello everyone,
 I would like to use the new AudioRecord class to record in PCM format.
 Create class and setRecordPositionUpdateListener to it, then start
 recording, I can't get any notification from system forever,why?(I
 didn't get any error when running)

 please help me, thanks.

 the next is my code.

 public class Recorder {
         private static final int AUDIO_SAMPLE_FREQ = 8000;
         private static final int AUDIO_BUFFER_SIZE = 20;

         private AudioRecord recorder;

         public Recorder()
         {
                 try
                 {
                         // init recorder
                         recorder = new 
 AudioRecord(MediaRecorder.AudioSource.MIC,
                                         AUDIO_SAMPLE_FREQ,
                                         
 AudioFormat.CHANNEL_CONFIGURATION_MONO,
                                         
 AudioFormat.ENCODING_PCM_16BIT,
                                         AUDIO_BUFFER_SIZE);
                 }
                 catch (IllegalArgumentException e)
                 {
                        e.printStackTrace();
                 }

                 
 recorder.setRecordPositionUpdateListener(mNotification);
                 recorder.setPositionNotificationPeriod(50);
                 
 recorder.setNotificationMarkerPosition(AUDIO_SAMPLE_FREQ);
         }

         public OnRecordPositionUpdateListener mNotification = new
                 OnRecordPositionUpdateListener(){
                 public void onMarkerReached(AudioRecord arg0) {
                         // read PCM buffer here
                         byte[] audioBuffer = new 
 byte[AUDIO_SAMPLE_FREQ];
                         arg0.read(audioBuffer, 0, AUDIO_SAMPLE_FREQ);
                 }

                 public void onPeriodicNotification(AudioRecord arg0) {
                         // read PCM buffer here
                         byte[] audioBuffer = new 
 byte[AUDIO_SAMPLE_FREQ];
                         arg0.read(audioBuffer, 0, AUDIO_SAMPLE_FREQ);
                 }

         public void StartRecord()
         {
                 recorder.startRecording();
         }

         public void StopRecord()
         {
                 recorder.stop();
         }

         public void ReleaseRecord()
         {
                 recorder.release();
         }

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

[android-developers] Re: SDK1.5 AudioRecord sample rate problem

2009-04-27 Thread Dave Sparks

I believe this is a known limitation of the emulator. There is a
feature request to allow for more sample rates, but no one is actively
working on it. The source code is available if someone wants to take
it on.

On Apr 25, 2:36 pm, szabolcs szabolcs.vr...@gmail.com wrote:
 Dave, Yoni,

 Thank you for replying.

  Is this on the emulator? If so, it may be a limitation of the emulator.

 Yes, I experienced the problem using the 1.5 prerelease SDK emulator.
 I dont know how the G1 would behave.

  Make sure you're using 16 bit samples..

 I have tried pretty much ALL permutations of the different parameters,
 including PCM_16BIT, with no DEFAULTS. Still, Recording works only
 with a sample rate of 8000Hz.

 From now on I will assume its an issue with the pre release 1.5
 emulator that will get fixed into the final version. Dave, is it
 enough that you know about this issue, or am I supposed to fill out a
 bugreport somewhere?

 Best regards,

 -szabolcs
--~--~-~--~~~---~--~~
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: MediaPlayer sound problem

2009-04-27 Thread Dave Sparks

Use SoundPool.

On Apr 26, 9:34 am, BlackLight blacklight1...@gmail.com wrote:
 I have other problem now. Lets say I have 10 buttons (0-9), when user
 press button program should play short (0.3-0.5 secs) sound. I added
 them as wav resources. Now I see that each MediaPlayer creates its own
 thread and takes resources. I'm not sure that this is good idea to
 make 10 players. But if I create player when user presses button it
 works fine only if user presses no more than 1 button in 2 secs. If
 user presses button each second or even several buttons a second, some
 sounds are silent. What's best solution for this problem on android?
 On Pocket PC we can play wav files fast - we create thread, that uses
 WaveIO and we have no silent sounds. How can we make sounds ready to
 play fast?

 On Apr 23, 7:18 pm, Marco Nelissen marc...@android.com wrote:

  Does it work with longer sounds?
  Have you tried using MediaPlayer.setLooping(true) instead of restarting it
  yourself from the OnCompletionListener callback?

  On Thu, Apr 23, 2009 at 12:00 AM, BlackLight 
  blacklight1...@gmail.comwrote:

   Hello.

   I have this task:
   Need to play short (0.3-0.4 sec) sounds all the time. When sound is
   played, it should start again, etc. User can press button to reset
   sound - it should stop and lunch.

   I did many tests. I tried to create 1 MediaPlayer, then do this:
          MediaPlayer.OnCompletionListener complListener = new
   MediaPlayer.OnCompletionListener()
          {
                  public void onCompletion(MediaPlayer mp) {
                          lunchSound(); // rewind
                  }
          };

          private boolean lunchSound()
          {
                  try
                  {
                          mplayer.seekTo(0); // move to start
                          mplayer.start();
                          return true;
                  }catch(Exception e){}
                  return false;
          }
   When user press button, I call lunchSound();

   It works great on emulator and on device if I have eclipse+debugger
   on.
   When I disconnect debugger, I have very strange errors - sound can
   stop at all (till program restart), sound can start repeating (play
   0.1-0.2 sec, then restart). Can someone please provide me some info
   about problem?
   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: SDK1.5 AudioRecord sample rate problem

2009-04-24 Thread Dave Sparks

Is this on the emulator? If so, it may be a limitation of the
emulator.

On Apr 24, 3:25 am, szabolcs szabolcs.vr...@gmail.com wrote:
 Steven,

 Thank you for your reply.

 I know AudioRecord works with a sample frequency of 8000Hz. In my
 initial post I was asking why this frequency is the ONLY frequency
 that works?!

 BTW, there is no exception thrown when the initialization of
 AudioRecord fails. I figured you are supposed to check that yourself
 by something like:
 if(mRecord.getState()==AudioRecord.STATE_INITIALIZED), not a try-catch
 block.

 So again: the question is, why does the initialization fail, if I
 supply the constructor with AUDIO_SAMPLE_FREQ= 11025 || 22050 ||
 44100?

 Thank you,

 -Szabolcs
--~--~-~--~~~---~--~~
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: AudioRecord can't get any notification when record/marker position updated

2009-04-24 Thread Dave Sparks

Did you enable audio input in the emulator?

On Apr 23, 6:48 pm, Steven_T gwb...@126.com wrote:
 hi Dave Sparks:
    I have changed 50 frames to 400 frmaes, it doesn't work.
    then I set bufferSizeInBytes to 100 to init AudioRecord object,
 and set update period to 400,
    it dosn't work too. I had used logcat to watch emulator'log, didn't
 find this program pid throwed error,
    Can you give me sample?
    thanks

 On Apr 24, 1:10 am, Dave Sparks davidspa...@android.com wrote:

  I suspect the problem is the interval you chose: 50 frames @ 8KHz is
  6.25 msecs. Your app is not going to be able to handle a callback
  every 6.25 msecs. Try something more reasonable like 50 msecs (400
  frames) and see if that works.

  On Apr 23, 1:56 am, Steven_T gwb...@126.com wrote:

   hello everyone,
   I would like to use the new AudioRecord class to record in PCM format.
   Create class and setRecordPositionUpdateListener to it, then start
   recording, I can't get any notification from system forever,why?(I
   didn't get any error when running)

   please help me, thanks.

   the next is my code.

   public class Recorder {
           private static final int AUDIO_SAMPLE_FREQ = 8000;
           private static final int AUDIO_BUFFER_SIZE = 20;

           private AudioRecord recorder;

           public Recorder()
           {
                   try
                   {
                           // init recorder
                           recorder = new 
   AudioRecord(MediaRecorder.AudioSource.MIC,
                                           AUDIO_SAMPLE_FREQ,
                                           
   AudioFormat.CHANNEL_CONFIGURATION_MONO,
                                           AudioFormat.ENCODING_PCM_16BIT,
                                           AUDIO_BUFFER_SIZE);
                   }
                   catch (IllegalArgumentException e)
                   {
                          e.printStackTrace();
                   }

                   recorder.setRecordPositionUpdateListener(mNotification);
                   recorder.setPositionNotificationPeriod(50);
                   recorder.setNotificationMarkerPosition(AUDIO_SAMPLE_FREQ);
           }

           public OnRecordPositionUpdateListener mNotification = new
                   OnRecordPositionUpdateListener(){
                   public void onMarkerReached(AudioRecord arg0) {
                           // read PCM buffer here
                           byte[] audioBuffer = new byte[AUDIO_SAMPLE_FREQ];
                           arg0.read(audioBuffer, 0, AUDIO_SAMPLE_FREQ);
                   }

                   public void onPeriodicNotification(AudioRecord arg0) {
                           // read PCM buffer here
                           byte[] audioBuffer = new byte[AUDIO_SAMPLE_FREQ];
                           arg0.read(audioBuffer, 0, AUDIO_SAMPLE_FREQ);
                   }

           public void StartRecord()
           {
                   recorder.startRecording();
           }

           public void StopRecord()
           {
                   recorder.stop();
           }

           public void ReleaseRecord()
           {
                   recorder.release();
           }

   };
--~--~-~--~~~---~--~~
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: AudioRecord can't get any notification when record/marker position updated

2009-04-23 Thread Dave Sparks

I suspect the problem is the interval you chose: 50 frames @ 8KHz is
6.25 msecs. Your app is not going to be able to handle a callback
every 6.25 msecs. Try something more reasonable like 50 msecs (400
frames) and see if that works.

On Apr 23, 1:56 am, Steven_T gwb...@126.com wrote:
 hello everyone,
 I would like to use the new AudioRecord class to record in PCM format.
 Create class and setRecordPositionUpdateListener to it, then start
 recording, I can't get any notification from system forever,why?(I
 didn't get any error when running)

 please help me, thanks.

 the next is my code.

 public class Recorder {
         private static final int AUDIO_SAMPLE_FREQ = 8000;
         private static final int AUDIO_BUFFER_SIZE = 20;

         private AudioRecord recorder;

         public Recorder()
         {
                 try
                 {
                         // init recorder
                         recorder = new 
 AudioRecord(MediaRecorder.AudioSource.MIC,
                                         AUDIO_SAMPLE_FREQ,
                                         
 AudioFormat.CHANNEL_CONFIGURATION_MONO,
                                         AudioFormat.ENCODING_PCM_16BIT,
                                         AUDIO_BUFFER_SIZE);
                 }
                 catch (IllegalArgumentException e)
                 {
                        e.printStackTrace();
                 }

                 recorder.setRecordPositionUpdateListener(mNotification);
                 recorder.setPositionNotificationPeriod(50);
                 recorder.setNotificationMarkerPosition(AUDIO_SAMPLE_FREQ);
         }

         public OnRecordPositionUpdateListener mNotification = new
                 OnRecordPositionUpdateListener(){
                 public void onMarkerReached(AudioRecord arg0) {
                         // read PCM buffer here
                         byte[] audioBuffer = new byte[AUDIO_SAMPLE_FREQ];
                         arg0.read(audioBuffer, 0, AUDIO_SAMPLE_FREQ);
                 }

                 public void onPeriodicNotification(AudioRecord arg0) {
                         // read PCM buffer here
                         byte[] audioBuffer = new byte[AUDIO_SAMPLE_FREQ];
                         arg0.read(audioBuffer, 0, AUDIO_SAMPLE_FREQ);
                 }

         public void StartRecord()
         {
                 recorder.startRecording();
         }

         public void StopRecord()
         {
                 recorder.stop();
         }

         public void ReleaseRecord()
         {
                 recorder.release();
         }

 };
--~--~-~--~~~---~--~~
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: Audio streaming/progressive download over HTTP

2009-04-23 Thread Dave Sparks

There is currently no support for Flash in Android.

On Apr 22, 7:37 pm, tainy tainy.zh...@gmail.com wrote:
 Thanks a lof , Dave.

 So I can use http streaming on H.264/H.263/MPEG4-SP
and use rtsp streaming on H.263/MPEG4-SP,  the issue with H.264
 will be fixed
 thanks for your work.

 what is more, how about the support for flash video(flv)? Do you know
 anything about that? and will it being supported for streaming?

 tainy

 On 4月23日, 上午7时59分, Dave Sparks davidspa...@android.com wrote:

  Progressive streaming using HTTP is well-supported.

  RTSP support isn't great yet, but it will get better with the 1.5
  release (Cupcake), which fixes the 302 redirect problem. There may be
  some issues with RTSP and H.264 - we found some issues with the
  hardware codec late in the test cycle that we're too risky to fix. H.
  263 and MPEG4-SP should work pretty well.

  The caveat with RTSP is that carriers may block the streams.

  On Apr 22, 2:04 am, tainy tainy.zh...@gmail.com wrote:

   Hi Dave:

   for audio streaming, only MPEG-4(AAC LC/LTP decoding) is supported,
   right?
   what about video streaming? I found no place saying that is not
   supported, but someone said video streaming is not available by now.
   and if it will be supported, what format will be ok for streaming?
   thanks!

   tainy

   On 4月16日, 上午3时40分, Dave Sparks davidspa...@android.com wrote:

AAC inside an MP4 file is fine. There is no support for raw AAC
streams.

On Apr 15, 5:53 am, patrick patrick.boul...@gmail.com wrote:

 When you say no support for AAC, does it mean no AAC support for
 pure audio stream?
 Can we use rtspstreamingwith a MPEG-4 video containing an AAC audio
 channel?

 On Apr 14, 11:56 pm, Dave Sparks davidspa...@android.com wrote:

  We don't have an API for progressive download yet. Technically, the
  website should say progressivestreaming, but from a file authoring
  perspective there is no distinction between the two.

  RTSP support is only available for MPEG-4 file formats. There is no
  support for raw AMR, AAC, or MP3 streams.

  On Apr 14, 1:12 pm, Alexander forw...@mail.ru wrote:

   Hi All,

   I have a couple questions regarding audiostreaming/progressive
   download over
   HTTP. Could you please help me?

   1. MediaPlayer supports progressive download according to the
   developer guide from
   this 
   linkhttp://developer.android.com/guide/topics/media/index.html
   (If you're
   passing a URL to an online media file, the file must be capable of
   progressive
   download.). As far as I understand progressive download means 
   media
   playback during
   download process with saving the media file to file system(SD 
   card or
   internal FS) after
   the downloading is finished (if it's a file, not a stream in the
   passed URL).
   So, I tried to set the following URL: setDataSource
   (http://84.204.154.49/mmapi/music.mp3). Playback is fine, but the 
   file
   isn't saved to
   SD card or internal phone file system. Can MediaPlayer save media
   content to the file system
   after downloading is completed? Is there a way to turn on such
   capability?

   2. Does MediaPlayer support HTTPstreaming? I tried to 
   usehttp://217.10.32.134:8129/ultrafan128.mp3,http://62.32.66.180:8800,
   also AMR-, AAC-
   audio stream over HTTP on the local server, but playback does not
   work. For example,
   RTSPstreamingworks fine with AMR and AAC.

   Thank you,
  Alexander- 隐藏被引用文字 -

- 显示引用的文字 -- 隐藏被引用文字 -

  - 显示引用的文字 -
--~--~-~--~~~---~--~~
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: Doesn't Android-1.0 support Recording Video well?

2009-04-23 Thread Dave Sparks

This forum is for application developers to discuss supported features
in the SDK. If you want to discuss Android framework, then please take
this to android-framework.

On Apr 22, 7:40 pm, david 1 david...@gmail.com wrote:
 OK, thanks. BTW, does OpenCore-2.01 or 2.02 support it?

 david

 2009/4/21 Marco Nelissen marc...@android.com

  1.0 doesn't support video recording at all.

  On Tue, Apr 21, 2009 at 2:56 AM, david 1 david...@gmail.com wrote:

  hi all,

  I just experienced the video recording on G1 based on the system.img of
  android1.0.  The process just lasts about 3 seconds, then blocks. And the
  generated file is empty. What's the matter? Doesn't this version support
  video recording, yet?

  david
--~--~-~--~~~---~--~~
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: Voice calls which uses its own audio instead of the build-in microphone

2009-04-22 Thread Dave Sparks

This is not possible. Telephony audio is handled by the baseband
processor and not accessible to the application processor.

On Apr 22, 3:27 pm, Jens K. jens.k...@googlemail.com wrote:
 Hi there,

 we're a group of students and trying to implement some kind of voice
 cryptography over a gsm connection (without modifing any gsm related
 codecs, we render pure audio which gets transmitted via gsm). Is it
 possible to initiate a voice call and transmit our generated audio
 signal (means bypassing the microphone as the primary audio source for
 that call)?
 I write this because I'm slightly worried after reading some posts on
 this list/group which states that the android.telphony APIs are
 private and can't be called from processes outside the the telephone
 subsystem.

 Kind regards,
  Jens
--~--~-~--~~~---~--~~
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: Audio streaming/progressive download over HTTP

2009-04-22 Thread Dave Sparks

Progressive streaming using HTTP is well-supported.

RTSP support isn't great yet, but it will get better with the 1.5
release (Cupcake), which fixes the 302 redirect problem. There may be
some issues with RTSP and H.264 - we found some issues with the
hardware codec late in the test cycle that we're too risky to fix. H.
263 and MPEG4-SP should work pretty well.

The caveat with RTSP is that carriers may block the streams.

On Apr 22, 2:04 am, tainy tainy.zh...@gmail.com wrote:
 Hi Dave:

 for audio streaming, only MPEG-4(AAC LC/LTP decoding) is supported,
 right?
 what about video streaming? I found no place saying that is not
 supported, but someone said video streaming is not available by now.
 and if it will be supported, what format will be ok for streaming?
 thanks!

 tainy

 On 4月16日, 上午3时40分, Dave Sparks davidspa...@android.com wrote:

  AAC inside an MP4 file is fine. There is no support for raw AAC
  streams.

  On Apr 15, 5:53 am, patrick patrick.boul...@gmail.com wrote:

   When you say no support for AAC, does it mean no AAC support for
   pure audio stream?
   Can we use rtspstreamingwith a MPEG-4 video containing an AAC audio
   channel?

   On Apr 14, 11:56 pm, Dave Sparks davidspa...@android.com wrote:

We don't have an API for progressive download yet. Technically, the
website should say progressivestreaming, but from a file authoring
perspective there is no distinction between the two.

RTSP support is only available for MPEG-4 file formats. There is no
support for raw AMR, AAC, or MP3 streams.

On Apr 14, 1:12 pm, Alexander forw...@mail.ru wrote:

 Hi All,

 I have a couple questions regarding audiostreaming/progressive
 download over
 HTTP. Could you please help me?

 1. MediaPlayer supports progressive download according to the
 developer guide from
 this linkhttp://developer.android.com/guide/topics/media/index.html
 (If you're
 passing a URL to an online media file, the file must be capable of
 progressive
 download.). As far as I understand progressive download means media
 playback during
 download process with saving the media file to file system(SD card or
 internal FS) after
 the downloading is finished (if it's a file, not a stream in the
 passed URL).
 So, I tried to set the following URL: setDataSource
 (http://84.204.154.49/mmapi/music.mp3). Playback is fine, but the file
 isn't saved to
 SD card or internal phone file system. Can MediaPlayer save media
 content to the file system
 after downloading is completed? Is there a way to turn on such
 capability?

 2. Does MediaPlayer support HTTPstreaming? I tried to 
 usehttp://217.10.32.134:8129/ultrafan128.mp3,http://62.32.66.180:8800,
 also AMR-, AAC-
 audio stream over HTTP on the local server, but playback does not
 work. For example,
 RTSPstreamingworks fine with AMR and AAC.

 Thank you,
Alexander- 隐藏被引用文字 -

  - 显示引用的文字 -
--~--~-~--~~~---~--~~
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: 1.5 SDK Media Question: why doesn't android.media.AudioFormat have option for AMR-NB?

2009-04-22 Thread Dave Sparks

No - telephony audio is handled entirely in the baseband processor.

On Apr 21, 10:14 pm, j jac...@gmail.com wrote:
 Thanks.

 One more question.  Doesn't the bundled Android phone/dialer app uses
 OpenCORE to encode and stream audio when user places a normal phone
 call?  How is that handled?

 On Apr 21, 5:24 pm, Dave Sparks davidspa...@android.com wrote:

  That is correct. The encoders are only available through the OpenCORE
  author engine which does not currently supporting a streaming
  interface.

  On Apr 21, 1:53 pm, j jac...@gmail.com wrote:

   I would like to use the new AudioRecord class to record in AMR-NB
   format.  But android.media.AudioFormat provides only 8-bit PCM and 16-
   bit PCM options, no AMR-NB option for some reason.

   I have also looked into MediaRecorder class.  My understanding is that
   while MediaRecorder supprots recording to AMR-NB format, MediaRecorder
   can only write to a file (not to a network stream).   It seems I need
   to use the AudioRecord class but it doesn't seem to support AMR-NB.

   Please shed some light!  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: 1.5 SDK Media Question: why doesn't android.media.AudioFormat have option for AMR-NB?

2009-04-21 Thread Dave Sparks

That is correct. The encoders are only available through the OpenCORE
author engine which does not currently supporting a streaming
interface.

On Apr 21, 1:53 pm, j jac...@gmail.com wrote:
 I would like to use the new AudioRecord class to record in AMR-NB
 format.  But android.media.AudioFormat provides only 8-bit PCM and 16-
 bit PCM options, no AMR-NB option for some reason.

 I have also looked into MediaRecorder class.  My understanding is that
 while MediaRecorder supprots recording to AMR-NB format, MediaRecorder
 can only write to a file (not to a network stream).   It seems I need
 to use the AudioRecord class but it doesn't seem to support AMR-NB.

 Please shed some light!  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: Question about rtsp streaming support on cupcake

2009-04-21 Thread Dave Sparks

There have been no changes in RTSP support for Cupcake other than a
couple of minor bug fixes.

On Apr 21, 2:46 am, caijing jcai2...@gmail.com wrote:
 Hi,

 I am doing development on RSTP streaming on cupcake. I want know more
 clear about it, so my question is, which version of 3GPP PSS has been
 support on cupcake, R4, R5 or R6?

 Thanks

 Cai Jing
--~--~-~--~~~---~--~~
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: u-law PCM audio compression supported in 1.5?

2009-04-20 Thread Dave Sparks

No, it only supports raw PCM.

On Apr 20, 2:36 pm, j jac...@gmail.com wrote:
 I can see from documentation that AudioRecord supports

 PCM 16 bit per sample
 and
 PCM 8 bit per sample

 Does it support things like u-law and a-law like the Java Media
 Framework?

 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: How can I test the video recording functionality in the new emulator

2009-04-17 Thread Dave Sparks

We are working on getting this fixed in the Cupcake SDK.

On Apr 16, 1:27 pm, Jason Proctor ja...@redfish.net wrote:
 right -- i got an error calling -

 recorder.setVideoSource (MediaRecorder.VideoSource.CAMERA)

 - which seemed to indicate that there isn't a shim for the video
 recording the way there is for still camera previews.

 I don't believe that video recording works in the emulator. It
 requires a hardware encoder module.

 On Apr 16, 9:18 am, ying lcs ying...@gmail.com wrote:
   Hi,

   How can I test the video recording functionality in the new emulator
   in 1.5 android preview SDK?

   Thank you.
--~--~-~--~~~---~--~~
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: Direct Video Encoder Access?

2009-04-16 Thread Dave Sparks

No, this would be impractical to do in Java.

On Apr 15, 11:16 pm, Sheado chad...@gmail.com wrote:
 Howdy,

 Does anybody know of a way to directly access the Video Encoders
 provided by the (android.media.MediaRecorder) API? I'd like to make
 changes to the raw camera data before it gets encoded.

 Thanks in advance!!
--~--~-~--~~~---~--~~
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: full screen support for an rtsp streaming video??

2009-04-15 Thread Dave Sparks

I'm not clear what you mean by full size.

VideoView displays as large as possible without distorting the aspect
ratio. For all releases through Cupcake, we assume the display is
HVGA. If videois  to fill the screen, it must be 1.333 aspect ratio.
For CIF or QCIF format, the aspect ratio is 1.222. To maintain correct
aspect ratio, there are bars along the sides of the video. If you want
any other behavior, you need to write your own version of VideoView.

On Apr 15, 12:23 pm, jayant jayant.jais...@gmail.com wrote:
 hi,

 I am able to play a local video in full screen through Mediaplayer

 But supplying an rtsp link to it gives a blank screen

 Using VideoView ,however, i am able to play the same rtsp link..but
 not in full size

 DavidSparks I am attaching a cc to you cos i have seen a similar kind
 of issue in your name

 Can anyone help me in playing a full screen rtsp video

 The Youtube application in G1 does so
--~--~-~--~~~---~--~~
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: Change to signature for Camera.setPreviewDisplay() in 1.5

2009-04-15 Thread Dave Sparks

The native code was throwing IOException even in 1.0, but it wasn't a
checked exception in Java. We felt it was best to expose it as a
checked exception since it can occur under normal circumstances when
another application or service has control of the camera.

On Apr 14, 11:10 pm, Tom Gibara m...@tomgibara.com wrote:
 Camera.setPreviewDisplay() now throws an IOException. Is there a reason this
 had to be a checked exception (looking at the source code I can't an see an
 immediate one)? Or is it just an oversight that will be fixed before
 releasing the final SDK?
 The consequence is that one cannot have code that will compile for both 1.1
 and 1.5 without doing something ugly like adding a blanket try/catch, or a
 dummy throw like:

 try {
   mCamera.setPreviewDisplay(holder);
   if (false) throw new IOException();} catch (IOException e) {

   /*handle exception*/

 }

 Tom.
--~--~-~--~~~---~--~~
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: Audio streaming/progressive download over HTTP

2009-04-15 Thread Dave Sparks

AAC inside an MP4 file is fine. There is no support for raw AAC
streams.

On Apr 15, 5:53 am, patrick patrick.boul...@gmail.com wrote:
 When you say no support for AAC, does it mean no AAC support for
 pure audio stream?
 Can we use rtsp streaming with a MPEG-4 video containing an AAC audio
 channel?

 On Apr 14, 11:56 pm, Dave Sparks davidspa...@android.com wrote:

  We don't have an API for progressive download yet. Technically, the
  website should say progressive streaming, but from a file authoring
  perspective there is no distinction between the two.

  RTSP support is only available for MPEG-4 file formats. There is no
  support for raw AMR, AAC, or MP3 streams.

  On Apr 14, 1:12 pm, Alexander forw...@mail.ru wrote:

   Hi All,

   I have a couple questions regarding audio streaming/progressive
   download over
   HTTP. Could you please help me?

   1. MediaPlayer supports progressive download according to the
   developer guide from
   this linkhttp://developer.android.com/guide/topics/media/index.html
   (If you're
   passing a URL to an online media file, the file must be capable of
   progressive
   download.). As far as I understand progressive download means media
   playback during
   download process with saving the media file to file system(SD card or
   internal FS) after
   the downloading is finished (if it's a file, not a stream in the
   passed URL).
   So, I tried to set the following URL: setDataSource
   (http://84.204.154.49/mmapi/music.mp3). Playback is fine, but the file
   isn't saved to
   SD card or internal phone file system. Can MediaPlayer save media
   content to the file system
   after downloading is completed? Is there a way to turn on such
   capability?

   2. Does MediaPlayer support HTTP streaming? I tried to 
   usehttp://217.10.32.134:8129/ultrafan128.mp3,http://62.32.66.180:8800,
   also AMR-, AAC-
   audio stream over HTTP on the local server, but playback does not
   work. For example,
   RTSP streaming works fine with AMR and AAC.

   Thank you,
      Alexander
--~--~-~--~~~---~--~~
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: Using 2 Surface Views in same activity

2009-04-15 Thread Dave Sparks

I'm pretty sure that this will not work. There is a limit of one video/
camera SurfaceView active at a time.

On Apr 15, 3:52 am, iblues iblues@gmail.com wrote:
 Hi,

 I am creating an application where I have 2 Surface Views (1 each in
 top and bottom half of the screen) along with a button. One of the
 Surface will be displaying a camera preview.

 The purpose of the action is to swap the preview between each frame.

 The problem I am facing is only one SurfaceView's surfaceCreated()
 callback is being called. So when I try to set the other SurfaceView
 for the camera preview, I get error as it is still not yet created.

 My question is when will a surface be actually created? And how can I
 accomplish this UI without using Intents?

 Regards,
 iblues
--~--~-~--~~~---~--~~
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: Phone call recorder

2009-04-15 Thread Dave Sparks

This is a limitation in the baseband processor - this is a feature the
hardware vendor would have to support.

On Apr 15, 2:01 am, Selem necrod...@gmail.com wrote:
 On Apr 6, 6:39 pm, Dave Sparks davidspa...@android.com wrote:

  You can't. The G1 firmware does not support it.

 Dave, do you mean G1 will never ever support call recording, or is
 there a chance that it will be supported with an update?



  On Apr 6, 6:00 am, Dilli dilliraomca...@gmail.com wrote:

   Hi i am developing a recorder application

   It works fine

   but when phone call comes it records only one way conversation

   but the caller voice is not recorded..

   I found audio sources as

    recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);

   OR

    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);

   How can i enable my application to record phone call ( Both
   conversation)

   Need help

   Thank you
   Dilli Rao.
--~--~-~--~~~---~--~~
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: Audio streaming/progressive download over HTTP

2009-04-14 Thread Dave Sparks

We don't have an API for progressive download yet. Technically, the
website should say progressive streaming, but from a file authoring
perspective there is no distinction between the two.

RTSP support is only available for MPEG-4 file formats. There is no
support for raw AMR, AAC, or MP3 streams.

On Apr 14, 1:12 pm, Alexander forw...@mail.ru wrote:
 Hi All,

 I have a couple questions regarding audio streaming/progressive
 download over
 HTTP. Could you please help me?

 1. MediaPlayer supports progressive download according to the
 developer guide from
 this linkhttp://developer.android.com/guide/topics/media/index.html
 (If you're
 passing a URL to an online media file, the file must be capable of
 progressive
 download.). As far as I understand progressive download means media
 playback during
 download process with saving the media file to file system(SD card or
 internal FS) after
 the downloading is finished (if it's a file, not a stream in the
 passed URL).
 So, I tried to set the following URL: setDataSource
 (http://84.204.154.49/mmapi/music.mp3). Playback is fine, but the file
 isn't saved to
 SD card or internal phone file system. Can MediaPlayer save media
 content to the file system
 after downloading is completed? Is there a way to turn on such
 capability?

 2. Does MediaPlayer support HTTP streaming? I tried to 
 usehttp://217.10.32.134:8129/ultrafan128.mp3,http://62.32.66.180:8800,
 also AMR-, AAC-
 audio stream over HTTP on the local server, but playback does not
 work. For example,
 RTSP streaming works fine with AMR and AAC.

 Thank you,
    Alexander
--~--~-~--~~~---~--~~
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: ERROR/MediaPlayer(1066): setDataSource called in state 128

2009-04-10 Thread Dave Sparks

MediaPlayer states are protected by mutexes in the native layer.
However, the playback complete is an asynchronous event that comes on
a binder worker thread. It's possible that you could call reset() in
the window after the native media player service has posted a playback
complete message to the binder interface, but before the client worker
thread has processed it. In this case, the playback complete message
would reset the client side of the interface to the stopped state.
Your subsequent setDataSource() call would fail.

If you wait for the playback complete message and then post a message
to your handler to start the next playback, you can avoid this
problem. Or as Marco suggests, create a second MediaPlayer object.
Just make sure you call release() on each one after you're done with
it to release the native resources.

On Apr 9, 8:23 pm, ATrubka atru...@gmail.com wrote:
 I agree that it's most likely me doing something wrong.
 It looks like when the audio file is about to end the state of
 MediaPlayer gets changed in the native code.
 And maybe reset() doesn't take effect during this process while
 setDataSource(), invoked right after, finds player not to be ready.

 Maybe Android music app creates MediaPlayer every time or synchronizes
 the invocations somehow.
 I wonder whether the situation I described is possible and if it is
 whether you can advise on the solution.

 I can create MediaPlayer all the time, but I'm afraid to use too many
 resources doing so.
 I'm usually reluctant to creation of unnecessary objects.

 I really appreciate your help and apologize for my not very deep
 knowledge of the player functionality.

 On Apr 9, 3:23 pm, Marco Nelissen marc...@android.com wrote:

  I am one, and the error you posted indicates you called setDataSource
  while the MediaPlayer was in the 'playback completed' state.
  It could be a race condition in the framework, but since I have never
  seen this problem occur with the Android music app, I'm inclined to
  think it's a problem with your code. As a workaround, you could create
  a new MediaPlayer when you want to play something new.

  On Wed, Apr 8, 2009 at 1:05 PM,ATrubkaatru...@gmail.com wrote:

   Guys, please...
   Is there any Android native code developers around?

   On Apr 8, 12:38 am,ATrubkaatru...@gmail.com wrote:
   MediaPlayer.reset() always gets invoked. Here's the exact lines of
   code:

                   _mediaPlayer.reset();
                   _mediaPlayer.setDataSource(resource);
                   _mediaPlayer.prepare();
                   _mediaPlayer.start();

   Additionally, the error occurs only when next audio starts while
   previous audio is about to end.
   If next audio starts in the middle of the playback or after it has
   completely stopped playing, then everything works fine.

   It looks pretty much like a synchronization issue to me.
   This method is not synchronized at the moment.
   Since most of the MediaPlayer code is native I'm not sure what should
   be synchronized.

   On Apr 7, 9:20 pm, Marco Nelissen marc...@android.com wrote:

Looks like you're calling MediaPlayer.setDataSource() on a MediaPlayer
that was already initialized, without first calling
MediaPlayer.reset()

On Tue, Apr 7, 2009 at 1:28 PM,ATrubkaatru...@gmail.com wrote:

 Hi, guys.

 I'm using MediaPlayer and sometimes when first audio is about to end
 and I click to the next audio I get the exception below. Looks like
 the MediaPlayer is in some weird state of stopping playing and cannot
 accept audio at the moment.

 The exception goes to the native code which is greeks to me.
 I couldn't find anything about this error on the internet either.

 Is anyone here familiar with the problem?

 Thank you in advance!

 04-07 20:19:35.855: ERROR/MediaPlayer(1066): setDataSource called in
 state 128
 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): Unable to play
 chapter audio
 04-07 20:19:35.855: ERROR/AudioPlayerService(1066):
 java.lang.IllegalStateException
 04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
 android.media.MediaPlayer.setDataSource(Native Method)
 04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
 com.tourizo.android.services.AudioPlayerService.playResource
 (AudioPlayerService.java:291)
 04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
 com.tourizo.android.services.AudioPlayerService.access$3
 (AudioPlayerService.java:287)
 04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
 com.tourizo.android.services.AudioPlayerService$1.playCurrentChapter
 (AudioPlayerService.java:89)
 04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
 com.tourizo.android.services.AudioPlayerRemoteInterface$Stub.onTransact
 (AudioPlayerRemoteInterface.java:99)
 04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
 android.os.Binder.execTransact(Binder.java:276)
 

[android-developers] Re: (pre- post-) processing raw audio data

2009-04-10 Thread Dave Sparks

No, this is not supported. If we ever do support it, it would require
a special permission that the user would have to grant, and it would
break for DRM content for obvious reasons.

On Apr 10, 1:44 am, devi prasad dpras...@gmail.com wrote:
 I want to develop an app that lets one intercept raw audio data sent for
 playback (possibly by a different app), and apply audio enhancements
 over this raw data.

 Does Cupcake allow such filtering of audio data? If so, which API should I 
 use?

 I understand this may not be possible at an application level for security
 reasons.  I'm trying to see if this is possible with native code
 linking to public
 or private API of Android.

 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: playing of wma audio

2009-04-10 Thread Dave Sparks

The Windows Media codecs are not part of OpenCORE. They require a
separate license which is typically negotiated between the hardware
manufacturer and the codec supplier.

On Apr 9, 4:49 am, l hx lihongxia8...@gmail.com wrote:
 now , the opencore can not play the audio of wma. is it right? and the total
 time of the wma file can not be find in the trackbrowseractivity. who know
 why?
--~--~-~--~~~---~--~~
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: Phone call recorder

2009-04-06 Thread Dave Sparks

You can't. The G1 firmware does not support it.

On Apr 6, 6:00 am, Dilli dilliraomca...@gmail.com wrote:
 Hi i am developing a recorder application

 It works fine

 but when phone call comes it records only one way conversation

 but the caller voice is not recorded..

 I found audio sources as

  recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);

 OR

  recorder.setAudioSource(MediaRecorder.AudioSource.MIC);

 How can i enable my application to record phone call ( Both
 conversation)

 Need help

 Thank you
 Dilli Rao.
--~--~-~--~~~---~--~~
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: any way to debug the service in system_server?

2009-04-03 Thread Dave Sparks

This is not the appropriate forum for this question. I suggest you try
in android-platform.

On Apr 2, 10:57 pm, Chen Yang sunsety...@gmail.com wrote:
 Resent, it seems that the thread to android-discuss is lost.

 -- Forwarded message --
 From: Chen Yang sunsety...@gmail.com
 Date: Fri, Apr 3, 2009 at 11:44 AM
 Subject: any way to debug the service in system_server?
 To: android-disc...@googlegroups.com

 I don't know whether this is the right forum for this thread. I am
 interested to know how to debug those services in system server, is
 there some known good approaches? Thanks.
 --
  Chen
--~--~-~--~~~---~--~~
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: ANR in Album with 100% CPU usage

2009-04-03 Thread Dave Sparks

Yes, ANR's occur because the task doesn't respond quickly enough to
user input. This can be caused by a background thread hogging the CPU.

I assume you are referring to the Pictures app (which will be called
Gallery in Cupcake). We have made some improvements in Cupcake will
continue to work on improving performance. It's not an easy problem,
given the amount of data involved in a large set of thumbnails.

On Apr 2, 10:19 pm, Hank And hank.and.gr...@gmail.com wrote:
 Hi all,

 I encounter an ANR in Album. I saw from the report that the CPU usage
 is nearly 100%, in which mediaserver occupied 80+%. It looks like it
 was decoding thumbnails. My questions are:

 1. Is it possible for ANRs to happen because the CPU is really busy?
 2. Do we have plan for Album to have a more efficient way to decode
 thumbnails?

 Thanks.

 Hank
--~--~-~--~~~---~--~~
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: Why does not SoundRecoder work on G1

2009-04-03 Thread Dave Sparks

You can access it via the Messaging (SMS/MMS) application by clicking
on attach and selecting record audio. I believe there's also an app in
market that exposes a launcher icon for it.

On Apr 2, 3:36 am, david david...@gmail.com wrote:
 hi everyone,

 I can see 'Sound Recorder' under Setting/Manage Applications. But I
 can not find any entry to run it.  Please help me.

 david
--~--~-~--~~~---~--~~
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: is video recording available in V1.1?

2009-04-03 Thread Dave Sparks

AMR recording does work. Try the SoundRecorder application, which can
be accessed by using the attach function in the Messaging app.

On Apr 2, 1:01 am, ambrosehua huang.p...@zte.com.cn wrote:
 It seems that Android doesn't support AMR recording currently, which
 is actually different from audio recording
 On 4月2日, 下午3时16分, david david...@gmail.com wrote:

  Hi zeeshan,

  I also tried audio recording of AMR on G1. But I'm failed. Could you
  please share your way with me? Thanks in advance.

  david

  On Mar 26, 2:46 am, zeeshan genx...@gmail.com wrote:

   Hi Experts,

   i am looking for video recording example, it suppose to be in api-
   sample but not available
   i am wondering if 1.1 release still missing this feature?

   if it does support then in which format and where is the example

   also i am trying to figure out mp3 encoding long ago but still no
   solution
   i have recorded an audio ()which is in AMR by default, how can i
   convert it in mp3 (any external package i can use?)
--~--~-~--~~~---~--~~
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: how to get the first frame of a video file ?

2009-04-03 Thread Dave Sparks

It's part of the system, not a separate class file you can import.

On Apr 2, 12:12 am, Wei twc0...@gmail.com wrote:
 Hi Dave,

 Currently, I need use android.media.MediaMetadataRetriever.
 I can find MediaMetadataRetriever.java in source code but there is no
 MediaMetadataRetriever.class build to out folder.
 Where can I get the class file.
 I need to import the android.media.MediaMetadataRetriever in my test
 AP.
 Thanks~~

 -wei

 On 3月8日, 上午2時29分, Dave Sparks davidspa...@android.com wrote:

  No, we're just adding support for extracting a static thumbnail.

  What is your use case? Where does the video stream come from?

  On Mar 5, 2:06 pm, elcadar mogrif...@gmail.com wrote:

   Will you be able to extract arbitrary frames from a video stream (not
   necessarily a file)? Essentially pull a frame every few seconds from
   outbound video stream and show a little image on screen?

   On Feb 11, 11:14 pm, Dave Sparks davidspa...@android.com wrote:

There is no support for thumbnail extraction in SDK 1.0. It's coming
in Cupcake as an adjunct to video record.

On Feb 11, 7:30 am, Freepine freep...@gmail.com wrote:

 Opencore has aframeandmetadatautility, and there is also an API as
 android.media.MediaMetadataRetriever.captureFrame()
 in Java layer, but it might not be available in public SDK.

 On Wed, Feb 11, 2009 at 8:49 PM, trust_chen chen 
 trustc...@gmail.comwrote:

  how to get the firstframeof a video file ?
  Are there such APIs in OPENCORE?
   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: play video error

2009-04-03 Thread Dave Sparks

It's pretty obvious that the path to your video file is located on
your Windows workstation. You have to remember the emulator is running
Linux in an emulation of an ARM processor. It doesn't have access to
the files on your workstation. You need to copy the video file to the
SD card emulation while the emulator is running using adb push.

On Apr 2, 12:05 am, Nithin nithi...@gmail.com wrote:
 Hi to all

              Can any one tell me how to play video in emulator... I
 tried but its give error
 Code is as below..

 package com.example;
 import android.app.Activity;
 import android.graphics.PixelFormat;
 import android.net.Uri;
 import android.os.Bundle;
 import android.util.Log;
 import android.widget.MediaController;
 import android.widget.Toast;
 import android.widget.VideoView;

 public class VideoViewDemo extends Activity {

     /**
      * TODO: Set the path variable to a streaming video URL or a local
 media
      * file path.
      */
     private String path = C:\Documents and Settings\nithin\My
 Documents\Downloads\disney_256v_32a.mp4;
     private VideoView mVideoView;

     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(R.layout.videoview);
         mVideoView = (VideoView) findViewById(R.id.surface_view);

         if (path == ) {
             // Tell the user to provide a media file URL/path.
             Toast.makeText(
                     VideoViewDemo.this,
                     Please edit VideoViewDemo Activity, and set path
                             +  variable to your media file URL/path,
                     Toast.LENGTH_LONG).show();

         } else {

             /*
              * Alternatively,for streaming media you can use
              * mVideoView.setVideoURI(Uri.parse(URLstring));
              */
             mVideoView.setVideoPath(path);
             mVideoView.setMediaController(new MediaController(this));
             mVideoView.requestFocus();

         }
     }

 }

 Thank You in advance
 Nithin N V
--~--~-~--~~~---~--~~
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: Why does not SoundRecoder work on G1

2009-04-03 Thread Dave Sparks

OpenCORE has no support for MP3 or QCELP encoding at this time, so
those are not options. If someone wants to contribute an open source
encoder and file composer, we would certainly be interested in
supporting it.

On Apr 3, 12:06 am, david 1 david...@gmail.com wrote:
 As it is known, the default format to be recorded is AMR. Is it to possible
 to replace it with another one, e.g. mp3 or qcelp? Frankly speaking, I want
 to let OpenCore support recording qcelp which is just one type of audio
 format.
 Could you please give me some clues about it, or what should I prepare or
 pay attention to? A summarizing info is also appreciated.  Many thanks in
 advance.

 I've issue this question 
 athttps://mail.google.com/mail/?hl=enzx=1mf4sjv3oovloshva=1#starred/1
 I'm sorry if it trouble you again. Please reply it just here. Thanks again.

 david

 2009/4/3 Dave Sparks davidspa...@android.com



  You can access it via the Messaging (SMS/MMS) application by clicking
  on attach and selecting record audio. I believe there's also an app in
  market that exposes a launcher icon for it.

  On Apr 2, 3:36 am, david david...@gmail.com wrote:
   hi everyone,

   I can see 'Sound Recorder' under Setting/Manage Applications. But I
   can not find any entry to run it.  Please help me.

   david
--~--~-~--~~~---~--~~
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: MediaPlayer sluggish to play sounds

2009-04-01 Thread Dave Sparks

Agreed. It takes about 100 msecs to spin up the audio output once it
goes to standby. You will seeing something like this in the log:

W/AudioFlinger(   35): write blocked for 103 msecs

If it's taking several seconds, there must be something else involved.

On Apr 1, 11:51 am, Marco Nelissen marc...@android.com wrote:
 I'm surprised that calling start() has no effect, and that it takes several
 seconds for playback to work again.
 Do you have the same issue when playing a file in the music player, for
 example?

 On Tue, Mar 31, 2009 at 5:35 PM, Eric M. Burke burke.e...@gmail.com wrote:



  I have an Activity that plays a brief OGG pop sound effect when
  bubbles pop. To keep it fast and to ensure I can play several pops, I
  create four MediaPlayer instances. I synchronize access to a pool of
  instances, so I can play up to four pops at once. Once a sound
  completes, I call seekTo(0) and return the MediaPlayer instance to my
  pool.

  Here is a rough sketch of the code:

  // when the activity resumes...
  for (int i=0; i4; i++) {
   MediaPlayer mp = MediaPlayer.create(context, R.raw.pop);
   mp.setOnCompletionListener(this);
   mp.setVolume(1f, 1f);
   players.add(mp); // put into a pool of available players
  }

  // when a bubble pops...
  MediaPlayer mp = ...get player instance from the pool
  if (mp != null) {
   mp.start(); // works! plays the pop sound
  }

  // implement the OnCompletionListener interface
  public void onCompletion(MediaPlayer mp) {
   // seek to the start so I can play the sound fast the next time
   mp.seekTo(0);
   return the MediaPlayer to the pool
  }

  Here is the problem. The pops all work so long as my game is active.
  But if I let it sit there for just a few seconds, I see this in the
  LogCat console: (on my G1 phone)

  AudioHardwareMSM72xx Going to standby

  Once this happens, the next several calls to MediaPlayer's start()
  method play nothing...but they do cause the audio hardware to wake up
  again, so then my sounds eventually (after a few seconds) start
  playing again.

  My question is, how do I prevent the AudioHardwareMSM72xx from going
  to standby mode while my Activity is active?

  One hacky idea...I could loop a continuous sound at extremely low
  volume level in another MediaPlayer instance to force it to stay
  awake. That's not appealing to me.

  Ideas?
--~--~-~--~~~---~--~~
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: playing video file

2009-04-01 Thread Dave Sparks

Have you looked at the VideoView widget?

On Apr 1, 2:41 am, jaimin jaiminmeht...@gmail.com wrote:
 hi,
 i have problem in playing video file. Video file is playing nice but i
 want to play video file in the whole emulator (size).Right now video
 file is playing but in small size.
 so any suggestion or solution plz help me.

 thanks.
 jaimin.
--~--~-~--~~~---~--~~
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: Media player -38 Error

2009-04-01 Thread Dave Sparks

Looks like you are repeatedly calling the MediaPlayer.start() method
when it is in an uninitialized state.

On Apr 1, 12:42 am, Ramesh uthir...@gmail.com wrote:
 Hi,

 I am trying to play media player.Its working fine but in log i am
 getting this kind of error
 Can anybody tell me why this error occured and how to solve this.

 03-29 14:33:02.529: ERROR/MediaPlayer(1980): Error (-38,0)
 03-29 14:33:02.539: ERROR/MediaPlayer(1980): start called in state 0
 03-29 14:33:02.539: ERROR/MediaPlayer(1980): Error (-38,0)
 03-29 14:33:02.539: ERROR/MediaPlayer(1980): start called in state 0
 03-29 14:33:02.539: ERROR/MediaPlayer(1980): Error (-38,0)
 03-29 14:33:02.539: ERROR/MediaPlayer(1980): start called in state 0
 03-29 14:33:02.539: ERROR/MediaPlayer(1980): Error (-38,0)
 03-29 14:33:02.549: ERROR/MediaPlayer(1980): start called in state 0
 03-29 14:33:02.549: ERROR/MediaPlayer(1980): Error (-38,0)
 03-29 14:33:02.549: ERROR/MediaPlayer(1980): start called in state 0
 03-29 14:33:02.549: ERROR/MediaPlayer(1980): Error (-38,0)
 03-29 14:33:02.549: ERROR/MediaPlayer(1980): start called in state 0
 03-29 14:33:02.559: ERROR/MediaPlayer(1980): Error (-38,0)
 03-29 14:33:02.559: ERROR/MediaPlayer(1980): start called in state 0
--~--~-~--~~~---~--~~
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: Video call support at Cupcake version.

2009-03-31 Thread Dave Sparks

Cupcake is based on OpenCORE 1.0. OpenCORE 2.0 was integrated into the
master branch, not Cupcake. You can find updated docs in the external/
opencore project.

Please bear in mind that while the VT low-level stack is included in
the OpenCORE 2.0 release, no work has been done to integrate with the
Android telephony stack. I do not expect to see VT integration for
products that ship in 2009, unless someone outside the Android team
takes on the work.

On Mar 31, 1:56 am, skan95 ska...@hanmail.net wrote:
 Hi all.

 Accroding to GregS's Announcing OpenCORE 2.0 release mention,
 video telephony (a.k.a. 2way) engine is supported by OpenCORE 2.0.
 but he(?) was not sure that is included at Cupcake version.

 So, can I get information about any progress for supporting video
 telephony service?
 like, whether video telehpony service is supported at Cupcake or any
 other version.

 And where can I get any document about OpenCORE 2.XXX release?

 Plz share your valuable knowledge.

 Thanks.

 Best regards.
 skan95.
--~--~-~--~~~---~--~~
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: handle Camera preview data without a SurfaceView

2009-03-25 Thread Dave Sparks

This is not currently possible.

On Mar 25, 11:11 am, denzel dimitri.deroc...@gmail.com wrote:
 Hello,

 I want to receive the data from the preview of the Camera, but without
 having to set a SurfaceView with a SurfaceHolder in the view of my
 application.

 I want to do something like this:

 Camera cam = Camera.open();
 cam.setPreviewCallback(new MyPreviewCallback());
 cam.startPreview();

 This will not work because I need to call setPreviewDisplay
 (SurfaceHoler) before I start the preview. I can get a SurfaceHolder
 from a SurfaceView, but I don't want a SurfaceView, because I don't
 need one. I just want to handle the preview data by myself. Any idees
 on how to deal with this?

 Thanks in advance!

 Denzel
--~--~-~--~~~---~--~~
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: opencore

2009-03-25 Thread Dave Sparks

The current G1 software uses the OpenCORE software codecs except for H.
264 where the hardware codec is used.

On Mar 25, 3:38 am, wangxianjian8311 wangxianjian8...@163.com wrote:
 hi all!
 i want to know whether the g1 use the pv omxcore in opencore . if i do 
 not have any hardware codec.
 if i just use the pv omxcore. can the system be commercial and steady?
--~--~-~--~~~---~--~~
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: Can i convert AMR to MP3 OR WAV in my activity?

2009-03-18 Thread Dave Sparks

No, there is no built-in package to convert from AMR to MP3 or WAVE.
If you want to do this in the current SDK, you'll need to write your
own code to do the conversion.

On Mar 18, 2:44 am, zeeshan genx...@gmail.com wrote:
 Hi Android Experts,

 i want to convert recorded AMR sound into mp3 or WAV within my
 activity, is there any method or package i can use?

 i am using this activity for recording:

 Intent intent = new Intent
 (MediaStore.Audio.Media.RECORD_SOUND_ACTION);
  startActivityForResult(intent, SELECT_AUDIO);

 this gives me amr content uri but my question is , how can i get the
 mp3/wav uri?

 i posted this question long ago but still no solution, please help me
 as i am really stuck on this.

 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: Mp3 file read problem in Real device (G1)

2009-03-18 Thread Dave Sparks

Just in case there is any confusion, your APK is not going to contain
the MP3 files that were loaded on the virtual SD card in the emulator.

If you want to play MP3's on the device's SD card, you need to install
them there, either by copying them from your workstation, downloading
them from the Internet, or by creating them within your program.

On Mar 17, 10:49 pm, jayesh.thadani jayesh.thad...@gmail.com
wrote:
 Hello friends,

 I have demo music player which reads mp3 files from virtual memory
 card of emulator

 I pass path something like this /sdcard and its working fine, at a
 time of reading MP3 from virtual memory card of emulator.

 But when this .apk is installed on real device G1, application is not
 been able to find any MP3 files from memory card of G1 device,

 Can any one suggest for this issue on real device G1, or can provide a
 code on how to read files from Memory card of G1.

 Thanks,
 Jayesh
--~--~-~--~~~---~--~~
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: class com.android.camera.UploadService does not exist?

2009-03-16 Thread Dave Sparks

We are planning to move to a model where most of the apps are built
against the SDK. Unfortunately, we're not quite there yet.

I expect to release a better camera sample application in the next
SDK. This one will be buildable against the SDK.

On Mar 16, 8:59 am, Hans hkess...@gmail.com wrote:
 On Mar 15, 1:06 pm, Abdul Mateen abmat...@gmail.com wrote:

  What do you mean by the camera Application, I have mostly used Camera in my
  applications, are you asking about the invocation of the camera, or
  something else?

 The Camera package, the system app denoted by Camera.apk.

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

  Hans :)
--~--~-~--~~~---~--~~
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: Thumbnails

2009-03-16 Thread Dave Sparks

We have a number of issues with metadata that need to be sorted out.
Unfortunately, it will have to wait until the next major release.

Unless I'm mistaken, micro-thumbnails are generated by the music
player for album art. This is just an optimization to improve list
flinging operations in the music browser.

On Mar 16, 1:20 pm, todd tdonahue...@gmail.com wrote:
 Having the camera app create thumbs when a photo is taken is great,
 but another common scenario has been left unanswered. What happens
 when the user inserts (or copies) images to the SD card?

 I've found that unless the Pictures app is run, no thumbs have been
 generated for the images on the SD card and I have to add the thumbs
 myself in order to display thumbnail images.

 Additionally, the gallery/camera apps only create the mini version of
 the thumbnail and not the micro version. It would be great to have a
 clear, consistent policy for thumbnail generation of images that
 reside on the SD card. I can foresee apps battling over thumb
 creation, some doing it well, others not so well and using different
 (custom?) sizes for both sizes.

 That's my two cents.

 Todd
--~--~-~--~~~---~--~~
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: Getting Raw Data from AMR-NB 3GP file

2009-03-13 Thread Dave Sparks

There are no public classes for decoding AMR to raw PCM. 3GPP is just
a thin wrapper around the raw AMR stream.

On Mar 13, 4:01 pm, benmccann benjamin.j.mcc...@gmail.com wrote:
 Any ideas on the easiest way to get the raw data from a file recorded
 by the MediaRecorder class?  I am going to have to pull up the RFC and
 parse the file myself or is there some existing Java/Android class I
 can use that recognizes the file format and will give me access to the
 raw decoded data?
 Also, what's the relationship between AMR and 3GPP?  Is one basically
 wrapping the other with a few extra file headers?
 When recording I set the following:
 recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
 recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

 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: Plan for setParameter in AudioManager.java

2009-03-11 Thread Dave Sparks

You should be asking this question in android-framework - this list is
for application developers.

However, the short answer is that we are removing this API in the next
major release. In fact, the entire audio architecture is going to get
a new treatment.

We are planning on a replacement for setParameter/getParameter that
will support atomic commits. So, if you do decide to use setParameter
now, it should not be difficult to merge your changes when the new API
is in place. I would prefer that you go this way over modifying the
binder interface and all the JNI. In fact, that's precisely why we
will continue to provide an API like this so you don' t have to worry
about mucking with binder code.

On Mar 10, 1:09 pm, SS shivank.si...@gmail.com wrote:
 Hello,

 We are planning on using setParameter() function in AudioManager.java
 for turning on/off some audio effects from the UI. This function goes
 all the way to the HAL layer. However, we see a comment in the code
 saying the following (pasted at the end of mail). So, my question is
 it okay to start using this API with our own defined set of
 (key,value) or is there a possibility of this function disappearing
 later. If yes, then is there any other recommended function to pass on
 UI settings all the way down to the HAL.

 Thanks.

 /*
  * Sets a generic audio configuration parameter. The use of these
 parameters
  * are platform dependant, see libaudio
  *
  * ** Temporary interface - DO NOT USE
  *
  * TODO: Replace with a more generic key:value get/set mechanism
  *
  * param key   name of parameter to set. Must not be null.
  * param value value of parameter. Must not be null.
  */
 /**
  * @hide
  */
 public void setParameter(String key, String value) {
 IAudioService service = getService();
 try {
 service.setParameter(key, value);
 } catch (RemoteException e) {
 Log.e(TAG, Dead object in setParameter, 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@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: Camera preview in ScrollView | Camera SurfaceView in XML layout

2009-03-11 Thread Dave Sparks

I don't know of anyone who has tested a video or camera preview
surface on a ScrollView. I suspect that it won't work on a G1. There
is a known issue using either of these on a TabView.

I derived my own CameraView widget from SurfaceView and placed it in
an XML layout. Works just fine.

On Mar 10, 4:40 pm, aklz lorenzaphotogra...@gmail.com wrote:
 All, is it possible to display a camera SurfaceView in a ScrollView?

 Also, does anybody have sample code to display a camera SurfaceView
 using an XML layout?  I've only been able to display a camera
 SurfaceView in my current view by calling addContentView.  This
 overlaps the current view which is not the desired behavior.  I'd like
 to add a small camera preview view somewhere in the current view.

 many thanks in advance!
--~--~-~--~~~---~--~~
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: Stream a very large mp3?

2009-03-11 Thread Dave Sparks

I've never tried an MP3 that big - it's quite possible that it won't
work. I think the largest file we ever tested was a one hour MP3 mix
file. I think it was about 70 MB.

On Mar 11, 6:25 pm, g1bb corymgibb...@gmail.com wrote:
 For the record, here is the code:

  MediaPlayer player = new MediaPlayer();

 player.setAudioStreamType(AudioManager.STREAM_MUSIC);

 try {

 player.setDataSource(http://mybigmp3.mp3;);
 } catch (IllegalArgumentException e1) {
 // TODO Auto-generated catch block
 e1.printStackTrace();
 } catch (IllegalStateException e1) {
 // TODO Auto-generated catch block
 e1.printStackTrace();
 } catch (IOException e1) {
 // TODO Auto-generated catch block
 e1.printStackTrace();
 }
 try {
 player.prepare();
 } catch (IllegalStateException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 } catch (IOException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 }
 player.start();

 And the logcat:
 03-12 01:22:10.996: WARN/System.err(324): java.io.IOException: Prepare
 failed.: status=0xFFF6
 03-12 01:22:10.996: WARN/System.err(324): at
 android.media.MediaPlayer.prepare(Native Method)
 03-12 01:22:10.996: WARN/System.err(324): at
 com.myapp.app.Main.onCreate(Main.java:35)
 03-12 01:22:10.996: WARN/System.err(324): at
 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
 1122)
 03-12 01:22:10.996: WARN/System.err(324): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2104)
 03-12 01:22:10.996: WARN/System.err(324): at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
 2157)
 03-12 01:22:10.996: WARN/System.err(324): at
 android.app.ActivityThread.access$1800(ActivityThread.java:112)
 03-12 01:22:10.996: WARN/System.err(324): at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1581)
 03-12 01:22:10.996: WARN/System.err(324): at
 android.os.Handler.dispatchMessage(Handler.java:88)
 03-12 01:22:10.996: WARN/System.err(324): at android.os.Looper.loop
 (Looper.java:123)
 03-12 01:22:11.006: WARN/System.err(324): at
 android.app.ActivityThread.main(ActivityThread.java:3739)
 03-12 01:22:11.006: WARN/System.err(324): at
 java.lang.reflect.Method.invokeNative(Native Method)
 03-12 01:22:11.006: WARN/System.err(324): at
 java.lang.reflect.Method.invoke(Method.java:515)
 03-12 01:22:11.006: WARN/System.err(324): at
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
 (ZygoteInit.java:739)
 03-12 01:22:11.006: WARN/System.err(324): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
 03-12 01:22:11.006: WARN/System.err(324): at
 dalvik.system.NativeStart.main(Native Method)
 03-12 01:22:11.006: ERROR/MediaPlayer(324): start called in state 0
 03-12 01:22:11.026: ERROR/MediaPlayer(324): Error (-38,0)

 On Mar 11, 7:00 pm, g1bb corymgibb...@gmail.com wrote:

  Hello,

  Is it possible to stream a very large mp3 using MediaPlayer? The mp3 I
  am interested in is over 270 mb.

  Thanks in advance!
--~--~-~--~~~---~--~~
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: Problems with support from T-mobile/General Question

2009-03-11 Thread Dave Sparks

I can't comment on T-Mobile's obligations to you - that is determined
by the terms of the agreement you signed when you signed up. The
Android team does have liaisons who work with the carriers and device
manufacturers and we receive bug reports from them.

On Mar 11, 2:56 pm, Joseph G evolutionar...@gmail.com wrote:
 Hello,

 I am having an issue that looks to be a bug on my Tmobile G1,  but T-
 mobile isn't helping me resolve or expedite it.  The bug details are
 listed here:http://code.google.com/p/android/issues/detail?id=2083.

 T-mobile claims that I have the responsibility to troubleshoot Android
 and file bugs for a phone they support and run on their network.
 Humorously enough I went to the Better Business Bureau and so they
 finally got back to me after 5 separate calls to support.  They claim
 2 things that I am wondering about...

 1. Do providers have responsiblity for interfacing with you the
 Android team in submitting bugs on behalf of their supported
 consumers?  Or does the consumer?

 2. Do you have a team within the Android group at Google that works
 with the provider networks?

 BTW, the particular senior customer service manager I spoke with
 said that the issue related to the fact that Android was open source.
 Being a user, supporter and advocate of FOSS I had to stop and laugh.
 xD  I asked him what that had to do with it and I got no response.
--~--~-~--~~~---~--~~
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: Does Camera API really works ?

2009-03-10 Thread Dave Sparks

In the future, we will officially support portrait mode camera.
Cupcake will have unofficial support (there will be a way to set it
to portrait mode through the setParameter interface), but I don't know
if we'll be able to make that work for other hardware.

On Mar 10, 3:11 am, Jun'ichi Hirayama hiraya...@gmail.com wrote:
 Hi David

 will you officially support the camera API in portrait mode?

 On Wed, Feb 18, 2009 at 1:08 AM, Dave Sparks davidspa...@android.comwrote:





  This code shouldn't even compile, this line is wrong:

  mCamera.takePicture(null, mPictureCallback); // requires 3 callback
  functions

  Camera is only supported in landscape mode. Cupcake release will
  unofficially support portrait mode (there will be no API for it, but
  I'll probably put some sample code out that shows how to do it).

  On Feb 16, 9:35 pm, cindy ypu01...@yahoo.com wrote:
   I tried google's camera API sample code. I found there are 2 problems:
   1 It only can take picture in Landscape orientation
   2 After click the space key, the application crashes. WOw:)

   XML:
   LinearLayout xmlns:android=http://schemas.android.com/apk/res/
   android
   android:layout_width=fill_parent
   android:layout_height=fill_parent
   android:orientation=vertical
   SurfaceView android:id=@+id/surface
   android:layout_width=fill_parent
   android:layout_height=10dip
   android:layout_weight=1
   /SurfaceView
   /LinearLayout
   Java code:
   /**
* Copyright (c) 2007, Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
   software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   implied.
* See the License for the specific language governing permissions
   and
* limitations under the License.
*/

   package com.android.cameraapitest;

   import android.app.Activity;
   import android.content.Intent;
   import android.graphics.Canvas;
   import android.graphics.Paint;
   import android.graphics.PixelFormat;
   import android.graphics.Rect;
   import android.net.Uri;
   import android.os.Handler;
   import android.os.Message;
   import android.os.Bundle;
   import android.provider.MediaStore.Images;
   import android.provider.MediaStore.Video;
   import android.view.Menu;
   import android.view.MenuItem;
   import android.view.SurfaceHolder;
   import android.view.SurfaceView;
   import android.view.KeyEvent;
   import android.hardware.Camera;

   import android.util.Log;

   public class CameraApiTest extends Activity implements
   SurfaceHolder.Callback
   {
   private static final String TAG = CameraApiTest;
   Camera mCamera;
   boolean mPreviewRunning = false;

   public void onCreate(Bundle icicle)
   {
   super.onCreate(icicle);

   Log.e(TAG, onCreate);

   getWindow().setFormat(PixelFormat.TRANSLUCENT);

   setContentView(R.layout.camera_api_test);
   mSurfaceView = (SurfaceView)findViewById(R.id.surface);

   mSurfaceHolder = mSurfaceView.getHolder();
   mSurfaceHolder.addCallback(this);
   mSurfaceHolder.setType
   (SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
   }

   public boolean onCreateOptionsMenu(android.view.Menu menu) {
   MenuItem item = menu.add(0, 0, 0, goto gallery);
   item.setOnMenuItemClickListener(new
   MenuItem.OnMenuItemClickListener() {
   public boolean onMenuItemClick(MenuItem item) {
   Uri target = Uri.parse(content://media/external/
   images/media);
   Intent intent = new Intent(Intent.ACTION_VIEW,
   target);
   startActivity(intent);
   return true;
   }
   });
   return true;
   }

   @Override
   protected void onRestoreInstanceState(Bundle savedInstanceState)
   {
   super.onRestoreInstanceState(savedInstanceState);
   }

   Camera.PictureCallback mPictureCallback = new
   Camera.PictureCallback() {
   public void onPictureTaken(byte[] data, Camera c) {
   Log.e(TAG, PICTURE CALLBACK: data.length =  +
   data.length);
   mCamera.startPreview();
   }
   };

   public boolean onKeyDown(int keyCode, KeyEvent event)
   {
   if (keyCode == KeyEvent.KEYCODE_BACK) {
   return super.onKeyDown(keyCode, event);
   }

   if (keyCode == KeyEvent.KEYCODE_SPACE) {
   mCamera.takePicture(null, mPictureCallback);
   return true;
   }

   return false;
   }

   protected void onResume()
   {
   Log.e(TAG

[android-developers] Re: Audio Volume

2009-03-10 Thread Dave Sparks

Please don't handle the volume keys yourself - it is almost impossible
to guarantee that you won't break the behavior of the volume keys.

Call this API in your onCreate():

setVolumeControlStream(AudioManager.STREAM_MUSIC);

This tells the AudioManager that when your application has focus, the
volume keys should adjust music volume.

On Mar 9, 8:17 pm, LukeH luke.hun...@gmail.com wrote:
 I ended up handling the volume button presses myself.  The solution I
 used is documented 
 here:http://stackoverflow.com/questions/628659/how-can-i-manage-audio-volu...

 On Mar 9, 7:39 pm, strazzere str...@gmail.com wrote:

  Then I'd recommend looking 
  here:http://sdk.androidin.com/reference/android/media/AudioManager.html

  More 
  specifically;http://sdk.androidin.com/reference/android/media/AudioManager.html#se...)

  audio.setStreamVolume(AudioManager.STREAM_MUSIC, #);

  On Mar 9, 10:22 pm, LukeH luke.hun...@gmail.com wrote:

   I'm a developer, I'm looking to change the behavior of my app, not
   install another app for changing the volume.  I need some way to make
   it so that volume button presses always adjust the music stream volume
   when my activity is showing whether a sound is playing at the time or
   not.

   On Mar 9, 7:16 pm, strazzere str...@gmail.com wrote:

Look at some of the applications on the market. Such as Master Volume
Controller.

You can lower the media volume, and raise your ringer volume.

On Mar 9, 9:58 pm, LukeH luke.hun...@gmail.com wrote:

 I also have exactly this issue. How can I fix it? Or as they say on
 internets, BUMP.

 On Feb 3, 2:28 am, blindfold seeingwithso...@gmail.com wrote:

  My app generates and plays sound samples in one second bursts, and
  this context sensitivevolumeadjustment keeps flipping between
  ringtonevolumeand mediavolumedepending on split second timing
  (apparently depending on whether a burst is playing or a next burst 
  is
  in preparation when thevolumebuttons are pressed). How can I pin
  down (lock?) the audio context to prevent this? Right nowvolume
  adjustment via thevolumebuttons is unworkable.

  Thanks.

  On Feb 2, 11:35 pm, Dave Sparks davidspa...@android.com wrote:

   Thevolumeadjustment is context sensitive. You can tell whichvolume
   is being adjusted by thevolumedisplay.

   If YouTube or the music player, adjusting thevolumewill affect 
   only
   the music/video playbackvolume. Thevolumedisplay will read Media
  Volume. If you're in the home screen, or most other apps that 
  don't
   use audio, adjusting thevolumewill affect the 
   ringtone/notification
  volume. Thevolumedisplay will read RingtoneVolume.
--~--~-~--~~~---~--~~
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: How to test the earpiece

2009-03-09 Thread Dave Sparks

If your app has the permission MODIFY_AUDIO_SETTINGS you can route
output to the earpiece using the setRouting API in AudioManager.

On Mar 9, 8:15 am, cht caoht...@gmail.com wrote:
 for the OEM, on the product line,we need to test the earpiece whether
 it works well.
 so I want to write a application which will play sounds through the
 earpiece.
 i want to know how can i play a sound through the earpiece?
 or if there is a better way to test the earpiece?
--~--~-~--~~~---~--~~
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: media player problem

2009-03-09 Thread Dave Sparks

Is this on a G1 or on the emulator?

On Mar 8, 10:18 pm, manoj manojkumar.m...@gmail.com wrote:
 Hi friends,

 I have developed a video playing application.

 I have a problem playing a video file.

 Actually it plays well (both audio and video are coming).

 But nothing is visible in the following scenario:

 The media file which is playing well when we first played, is not
 playing well when we play it after playing the high quality media file
 which wont play at all.

 scenario:
 play v1.  --- playing well (both
 video and audio are coming).
 then
 play v2 (high quality media file) --- not playing at all(neither
 video nor audio are coming).
 then
 play v1   --- not playing well
 (it should play, but only audio is coming, no video is coming).

 here v1, v2 are video files.

 The log is here:
 I/MediaPlayer-JNI(  441): prepareAsync: surface=0x1e14f8 (id=2)
 D/MediaPlayerDemo(  441): surfaceChanged called
 E/MemoryHeapBase(   31): mmap(fd=20, size=233472) failed (Invalid
 argument)
 E/VideoMIO(   31): Error creating frame buffer heap
 D/MediaPlayerDemo(  441): onPrepared called

 can any one please help to solve this problem.

 Thanks,
 Manoj.
--~--~-~--~~~---~--~~
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: URGENT - video playing problem

2009-03-07 Thread Dave Sparks

The H.264 codec in the G1 is baseline profile Level 1.3. Maximum frame
size is 480x320 (happily the same dimensions as the screen).
Recommended maximum bit rate is 384Kbps. Maximum frame rate is 30 fps.
It does not support B-frames (consistent with baseline profile). If
you stay within these bounds, you should have good performance.

That said, with a good encoder, you can push the bit rate a bit
higher. The important thing is that it not be too bursty, the decoder
can handle a few frames at double the bit rate, but eventually it will
fall behind. I've even had the audio track screw up when I pushed it
too hard.

On Mar 7, 4:08 am, Freepine freep...@gmail.com wrote:
 I have no specific knowledge about the error code returned ( perhaps a
 Qualcomm or HTC guy can give some hints:), so I can't give you concrete
 suggestions about what to do exactly...
 Anyway, I did a search in google and found below link might be helpful to
 you:http://techlime.com/mobiles-cellphones-handhelds-pda/mp4htchd-new-eas...

 On Sat, Mar 7, 2009 at 8:03 PM, manoj manojkumar.m...@gmail.com wrote:

  can you please suggest me how to use the transcode tool to convert the
  original clip to lower profile?

  I will be thankful to you if I got this answer.

  Thanks,
  Manoj.

  On Mar 7, 4:58 pm, Freepine freep...@gmail.com wrote:
   You are welcome, and It might be possible to use a video transcode tool
  to
   convert the original clip to lower profile, resolution or frame rate, but
  I
   guess using another file would be the easiest way :)

   On Sat, Mar 7, 2009 at 7:46 PM, manoj manojkumar.m...@gmail.com wrote:

thanks for your reply.

On Mar 7, 4:44 pm, Freepine freep...@gmail.com wrote:
 Probably not:)

 On Sat, Mar 7, 2009 at 7:34 PM, manoj manojkumar.m...@gmail.com
  wrote:

  can't I do anything to play it perfectly?

  Thanks,
  Manoj.

  On Mar 7, 4:29 pm, Freepine freep...@gmail.com wrote:
   It looks Qualcomm omx decoder couldn't be initialized
  successfully
for
  your
   video clip. Perhaps you can try with another video file.

   On Sat, Mar 7, 2009 at 5:31 PM, manoj manojkumar.m...@gmail.com

wrote:

Hi,

I have written a small video playing application.

I installed it on Android dev phone.

I am trying to play a video file, but got the following error.

E/QCvdecH264(   31): get_parameter: unknown param 0ff7a347
W/QCvdec  (   31): vdec: opened
W/QCvdec  (   31): VDL_Configure_HW: Interface Not supported
E/QCvdec  (   31): Driver Layer hardware config failed with
  error
code
7
W/QCvdec  (   31): error - H264Decoder::InitializeDecInternal()
failed!!
W/QCvdec  (   31): There is no input node available
E/QCvdec  (   31): partner/qct/proprietary/libOmxH264Dec/
vdecoder_i.cpp:952 *** ERROR ASSERT(0)
W/        (   31): [vdec_core] vdec_queue error: 5
W/        (   31): [vdec_core] frame buffer malloc failed,
  index: 8
W/QCvdec  (   31): Unable to allocate buffers (out of memory)
W/QCvdec  (   31): VDL_Configure_HW: Interface Not supported
E/QCvdec  (   31): Driver Layer hardware config failed with
  error
code
7
W/QCvdec  (   31): error - H264Decoder::InitializeDecInternal()
failed!!

can any one please help me to solve this problem.

Thanks,
Manoj.
--~--~-~--~~~---~--~~
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: how to get the first frame of a video file ?

2009-03-07 Thread Dave Sparks

No, we're just adding support for extracting a static thumbnail.

What is your use case? Where does the video stream come from?

On Mar 5, 2:06 pm, elcadar mogrif...@gmail.com wrote:
 Will you be able to extract arbitrary frames from a video stream (not
 necessarily a file)? Essentially pull a frame every few seconds from
 outbound video stream and show a little image on screen?

 On Feb 11, 11:14 pm, Dave Sparks davidspa...@android.com wrote:

  There is no support for thumbnail extraction in SDK 1.0. It's coming
  in Cupcake as an adjunct to video record.

  On Feb 11, 7:30 am, Freepine freep...@gmail.com wrote:

   Opencore has aframeand metadata utility, and there is also an API as
   android.media.MediaMetadataRetriever.captureFrame()
   in Java layer, but it might not be available in public SDK.

   On Wed, Feb 11, 2009 at 8:49 PM, trust_chen chen 
   trustc...@gmail.comwrote:

how to get the firstframeof a video file ?
Are there such APIs in OPENCORE?
 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: Can't get screen capture

2009-03-07 Thread Dave Sparks

I believe screen capture is disabled in production devices for
security reasons.

On Mar 5, 7:49 pm, volk...@aol.com volk...@aol.com wrote:
  I'm having trouble getting a screenshot. I installed the SDk,
 Eclipse, the drivers, enable usb debugging, like the instructions say.
 I open DDMS and it recognizes my phone without any problems. When I
 try to do a screen capture, it says screen not available. In the
 command box it says timeout and truncated reply from ADB fb data.
 Does anyone know what I'm doing wrong?

 My phone isn't rooted and is running RC33. I'm running windows vista
 on my computer.

 Any help would be greatly appreciated. Thanks.
 Reply With Quote
--~--~-~--~~~---~--~~
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: manipulating markets popularity! - why should i develop app for android

2009-03-07 Thread Dave Sparks

Filing a bug is the way to get things fixed. Most Google Android
engineers do not read this list. They do respond to bug reports
though.

On Mar 7, 3:01 pm, Stoyan Damov stoyan.da...@gmail.com wrote:
 On Sat, Mar 7, 2009 at 8:58 PM, strazzere str...@gmail.com wrote:

  Your interaction with the market is also logged with your android id
  -- which also seems to be linked to a gmail account you use on that
  device.

  So I'm assuming this could be tracked - and if google wanted to, they
  could see. Hmmm 150+ users with the same android id? All commenting
  and install the same application?

 That is, if Google cares. All I've seen is oh, really? file a bug.
 As if it's I put a padding of 10 dips but it looks like 9. I don't
 think such *very* important matter could be taken so easily. This is
 not simply a bug - it could be a showstopper for those who wouldn't
 exploit it, and a powerful weapon for those who would.

 P.S.
 Sorry for cutting the rest of the conversation -- it just got too big.
--~--~-~--~~~---~--~~
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: Problem with video playing

2009-03-06 Thread Dave Sparks

If you are trying to play this on a G1, the frame size is too large.
The H.264 codec is base profile up to HVGA (480x320).

It's pointless to encode at VGA when the screen is HGVA - you're
wasting half your bandwidth for pixels you will never see.

On Mar 6, 1:42 am, manoj manojkumar.m...@gmail.com wrote:
 Hi,

 I have created a small application which plays video file.

 I am using .mp4 files to play.

 Its working for only some files, but for some files, I am getting only
 audio there is no video at all.

 When I observed the properties of the media files,

 1. Format: MPEG-4 Video, 320*240, AAC Movie FPS:29.97, Data size:
 3.76, Data Rate:316.03 kbps, noram size:320*240, current size:320*240
 - PLAYING PERFECTLY

 2. Format:h.264, 640*480, AAC Movie FPS: 29.97  data size:25.76 MB
 noramal size : 640*480, current size:640*480
 - NO VIDEO, ONLY AUDIO.

 can any one please suggest me, how to solve this issue.

 Thanks,
 Manoj.
--~--~-~--~~~---~--~~
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: MediaPlayer not running - just blank screen

2009-03-04 Thread Dave Sparks

You need to tell the mediaplayer where to display the video with
setDisplaySurface(). Check out the media demo apps on
developer.android.com.

On Mar 4, 11:45 pm, Nithin nithin.war...@gmail.com wrote:
 hi,

 I tried a simple mediaplayer application, just to run a .3gp file.
 First, i put the .3gp file in Raw folder and tried to run, but
 nothing is displaying, just blank screen only please guide me,
 where i am going wrong. I dont have any xml file, is it needed ??

 heres the code, which i am trying

 import android.app.Activity;
 import android.media.MediaPlayer;
 import android.os.Bundle;

 public class MonsterEntry extends Activity {

         public void onCreate(Bundle savedInstanceState) {
                 super.onCreate(savedInstanceState);
                 MediaPlayer mediaplayer = MediaPlayer.create(this, 
 R.raw.monster);
                 mediaplayer.start();
         }

 }

 Thanks
 Nithin
--~--~-~--~~~---~--~~
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: what is the recording format of Intent .RECORD_SOUND_ACTION?

2009-03-04 Thread Dave Sparks

The only audio format supported on G1 is AMR format (raw .AMR file).

On Mar 4, 1:18 pm, zeeshan genx...@gmail.com wrote:
 Hi,

 can anyone tell me what is the default format of android recording.
 i have recorded an audio clip but dont know how can i check its
 extention?

 i am using this activity

 Intent intent = new Intent
 (MediaStore.Audio.Media.RECORD_SOUND_ACTION);
 startActivityForResult(intent, ACTIVITY_RECORD_SOUND);

 i need mp3/wav format, is it the same or do i need to convert it? how?

 please reply me

 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: Taking picture by camera correct intent action and extras?

2009-03-03 Thread Dave Sparks

The image capture intents for the 1.0 and 1.1 releases only allow for
small images intended for email or MMS attach. The next SDK release
for Cupcake will add support for setting the image size.

On Mar 2, 9:00 pm, Ondra Zahradnik ondra.zahrad...@gmail.com wrote:
 Hello I am trying to take picture by G1 camera.

 I have tried almost everything i was able to find on the net about
 this topic. It seams there should be intent with action
 android.media.action.IMAGE_CAPTURE which really starts camera
 application and returns captured image. But captured image is scaled
 to 0.25 of original size.
 Another possibility I have found is to pass uri where to save captured
 image. I went through all available sources of camera application and
 it should work but does not.

 For illustration, I am doing following in my example activity which
 creates new image, but after returning from camera, image is still
 empty:
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);

 ContentValues values = new ContentValues();
 values.put(Media.TITLE, Image);
 values.put(Media.DESCRIPTION, Image capture by camera);
 Uri uri =
 getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);

 Intent i = new Intent(android.media.action.IMAGE_CAPTURE);
 i.putExtra(output, uri);
 startActivityForResult(i, 1);
 }

 I am ready to write my own capturing application, but it is quite hard
 and I would like to reuse.

 Please, do you know correct intent action name and extra name to pass
 to capture image?

 Thank you very much.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   3   4   >