[android-developers] Re: Audio in the emulator...

2009-01-31 Thread nicolas cosson

Hello,

I have been searching for some time and I can't find a detailled
tutorial on how to easily record and then read audio on the emulator
under eclipse. I have found these steps:

- You have to install a virtual sd card with mksdcard.exe 1024M
sdimg.iso

-then run the emulator : emulator.exe -sdcard
sdimg.iso//where sdimg.iso it is the path to
the sdcard

-then run adb.exe : adb push local_file sdcard/remote_file

-then you should put :  in
the androidmanifest.xml

-then there is some code to implement which should look like :
private void startRecord() {

   recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);  //ok so
I say audio source is the microphone, is it windows/linux microphone
on the emulator?
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile("/sdcard/test.3gpp");

recorder.prepare();
recorder.start();


}

-then you should stop with : recorder.stop(); // at some point (I have
no idea when and where to decide to stop but I haven't searched yet)

-then you should play it.



I have also heard about : 
http://code.google.com/intl/fr/android/reference/emulator.html#sdcard
in this page of the manual (~1/4 of the total scroll), there are some
informations about "Emulator Startup Options", one of them is about
Media  -audio 
I couldn't find much about that backend thing, google didn't said much
about it. I still don't know if it's important to the audio recording
process.


The fact is all these steps are pretty blurry to me, and I believe I
am not the only android newbie trying to record some sound :)

Anyone knows where we can find a complete tutorial "for dummies"
teaching this feature?

Any help is of course greatly appreciated

Thanks.

On 27 jan, 20:08, Breno  wrote:
> Hey Andrei,
>
>            To recordaudioit's pretty easy. But, you must record in
> sdcard, only. Be sure your path to file it's pointing to sdcard, and
> you have one mounted in eclipse (or something else). It's working
> perfectly.
>
> Regards
>
> Breno
>
> On Jan 15, 8:58 am, "Andrei Craciun"  wrote:
>
> > Thanks David...
>
> > 2009/1/15 David Turner 
>
> > > the emulator now supportsaudiorecording. If you have problems with it,
> > > you should report mode detailed information about it here
>
> > > On Thu, Jan 15, 2009 at 11:05 AM, Andrei Craciun 
> > > wrote:
>
> > >> Hi All,
> > >> As reported on this blog:
> > >>http://blog.roychowdhury.org/2008/04/29/sip-ua-for-android-stack-rtp-...some
> > >> problems inrecordingaudioon the emulator, but everything
> > >> works fine on the real phone. Does anyone has a workaround forrecording
> > >>audioon the emulator?
>
> > >> Thanks in advance,
> > >> A.

--~--~-~--~~~---~--~~
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: MediaRecorder - No value other than 0 returned from getMaxAmplitude

2009-01-31 Thread nicolas cosson

are you testing it on the emulator or on the G1 device?

I'm not sure about it but I've read around some forums that you need a
virtual sd card to record audio on the emulator. (with the
mksdcard.exe in the tools provided with the sdk)
Some other sources also say it isn't possible to record audio on the
emulator yet.

Check if you can read/hear what you have recorded since you are using
a sdcard, maybe the sdcard is too small.

Why would you use a thread to return the max amplitude?

I am myself looking forward to record audio on the emulator and
constantly find contradictory informations about whether it's possible
or not.
the manual says it's not.

Any insight about that is appreciated in addition to the upper
problem.

thanks



On 31 jan, 15:12, "ph...@grantmidwinter.com"
 wrote:
> I've got a media recorder, prepared and started in the following way:
>
> mRecorder = new MediaRecorder();
>             mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
>             mRecorder.setOutputFormat
> (MediaRecorder.OutputFormat.THREE_GPP);
>             mRecorder.setAudioEncoder
> (MediaRecorder.AudioEncoder.AMR_NB);
>             mRecorder.setOutputFile("/sdcard/test.3gpp");
>             mRecorder.prepare();
>             mRecorder.start();
>
> I'm then using a thread to return the mRecorder.getMaxAmplitude int,
> but it never returns as anything but 0. I've looked all over for why
> this might be happening - but I'm at a complete loss now so help would
> really be appreciated.
>
> 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: Audio in the emulator...

2009-02-01 Thread Nicolas Cosson
Thanks for the advice,

I work on windows vista,

the audio  found is:
 winaudioWindows wave audio
But it doesn't work with audio-out and audio-in at the same time for me.
emulator: warning: opening audio output failed

audio-out works alone
I tested it with the sample provided with the sdk when reading ressources.
It doesn't when trying to read the sdcard.

the sdcard isn't readable in settings too, and it won't launch itself from
eclipse with the additionnal emulator command line option, but only from
cmd.exe with the arguments -sdcard sdimg.iso

However, the logcat says this repetitivly when I click on record with
audio-in:
D/AudioHardware<   25>: AudioStreamInGeneric::read<0x40308160, 320> from fd
7

I finally found the sound recorder application you where talking about, I
haven't tested it yet, but the source code is 100* bigger than mine...
http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder.git;a=blob;f=src/com/android/soundrecorder/Recorder.java;h=5fe41b0b4086b652ee6792d931b251a0799747dc;hb=HEAD



Maybe I have made a mistake somewhere, any help is greatly appreciated

thanks for your time





On Sun, Feb 1, 2009 at 5:15 AM, Dave Sparks  wrote:

>
> Try this:
>
> emulator -help-audio-in
>
> It will tell you which audio backends are available on your system.
> You didn't specify what OS you are using.
>
> I think there was also some sample code in the SDK at one point. Maybe
> one of the developer advocates can point you to it. Another option is
> to look for the source for the Sound Recorder application on
> source.android.com. It should be in packages/apps/SoundRecorder.
>
> On Jan 31, 10:45 am, nicolas cosson  wrote:
> > Hello,
> >
> > I have been searching for some time and I can't find a detailled
> > tutorial on how to easily record and then read audio on the emulator
> > under eclipse. I have found these steps:
> >
> > - You have to install a virtual sd card with mksdcard.exe 1024M
> > sdimg.iso
> >
> > -then run the emulator : emulator.exe -sdcard
> > sdimg.iso//where sdimg.iso it is the path to
> > the sdcard
> >
> > -then run adb.exe : adb push local_file sdcard/remote_file
> >
> > -then you should put :  > android:name="android.permission.RECORD_AUDIO"> in
> > the androidmanifest.xml
> >
> > -then there is some code to implement which should look like :
> > private void startRecord() {
> >
> >recorder = new MediaRecorder();
> > recorder.setAudioSource(MediaRecorder.AudioSource.MIC);  //ok
> so
> > I say audio source is the microphone, is it windows/linux microphone
> > on the emulator?
> >
> recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
> > recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
> > recorder.setOutputFile("/sdcard/test.3gpp");
> >
> > recorder.prepare();
> > recorder.start();
> >
> > }
> >
> > -then you should stop with : recorder.stop(); // at some point (I have
> > no idea when and where to decide to stop but I haven't searched yet)
> >
> > -then you should play it.
> >
> > I have also heard about :
> http://code.google.com/intl/fr/android/reference/emulator.html#sdcard
> > in this page of the manual (~1/4 of the total scroll), there are some
> > informations about "Emulator Startup Options", one of them is about
> > Media  -audio 
> > I couldn't find much about that backend thing, google didn't said much
> > about it. I still don't know if it's important to the audio recording
> > process.
> >
> > The fact is all these steps are pretty blurry to me, and I believe I
> > am not the only android newbie trying to record some sound :)
> >
> > Anyone knows where we can find a complete tutorial "for dummies"
> > teaching this feature?
> >
> > Any help is of course greatly appreciated
> >
> > Thanks.
> >
> > On 27 jan, 20:08, Breno  wrote:
> >
> > > Hey Andrei,
> >
> > >To recordaudioit's pretty easy. But, you must record in
> > > sdcard, only. Be sure your path to file it's pointing to sdcard, and
> > > you have one mounted in eclipse (or something else). It's working
> > > perfectly.
> >
> > > Regards
> >
> > > Breno
> >
> > > On Jan 15, 8:58 am, "Andrei Craciun"  wrote:
> >
> > > > Thanks David...
> >
> >

[android-developers] Re: Audio in the emulator...

2009-02-02 Thread nicolas cosson

The problem is now resolved, I had make several mistakes:

I had forgot to release the recorded sound. (record.release();)
I hadn't put the complete path for the sdcard which in fact prevented
the emulator from loading one.
audio-in is useless with windows, plug and play does the job.
I didn't play the sound from the path I had recorded it in.
The sdcard must be a *.img file and not a *.iso (*.iso doesn't work
for me)

thanks


On Feb 2, 11:51 pm, Dave Sparks  wrote:
> Sorry, I don't have a Windows machine for testing. Maybe one of our
> developer advocates can help you with that.
>
> From the debug spew from the audio input driver, it sounds like it
> should be recording. Do you see the file being written to the SD card?
>
> On Feb 1, 2:45 am, Nicolas Cosson  wrote:
>
> > Thanks for the advice,
>
> > I work on windows vista,
>
> > the audio  found is:
> >  winaudio                Windows wave audio
> > But it doesn't work with audio-out and audio-in at the same time for me.
> > emulator: warning: opening audio output failed
>
> > audio-out works alone
> > I tested it with the sample provided with the sdk when reading ressources.
> > It doesn't when trying to read the sdcard.
>
> > the sdcard isn't readable in settings too, and it won't launch itself from
> > eclipse with the additionnal emulator command line option, but only from
> > cmd.exe with the arguments -sdcard sdimg.iso
>
> > However, the logcat says this repetitivly when I click on record with
> > audio-in:
> > D/AudioHardware<   25>: AudioStreamInGeneric::read<0x40308160, 320> from fd
> > 7
>
> > I finally found the sound recorder application you where talking about, I
> > haven't tested it yet, but the source code is 100* bigger than 
> > mine...http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder...
>
> > Maybe I have made a mistake somewhere, any help is greatly appreciated
>
> > thanks for your time
>
> > On Sun, Feb 1, 2009 at 5:15 AM, Dave Sparks  wrote:
>
> > > Try this:
>
> > > emulator -help-audio-in
>
> > > It will tell you which audio backends are available on your system.
> > > You didn't specify what OS you are using.
>
> > > I think there was also some sample code in the SDK at one point. Maybe
> > > one of the developer advocates can point you to it. Another option is
> > > to look for the source for the Sound Recorder application on
> > > source.android.com. It should be in packages/apps/SoundRecorder.
>
> > > On Jan 31, 10:45 am, nicolas cosson  wrote:
> > > > Hello,
>
> > > > I have been searching for some time and I can't find a detailled
> > > > tutorial on how to easily record and then read audio on the emulator
> > > > under eclipse. I have found these steps:
>
> > > > - You have to install a virtual sd card with mksdcard.exe 1024M
> > > > sdimg.iso
>
> > > > -then run the emulator : emulator.exe -sdcard
> > > > sdimg.iso                        //where sdimg.iso it is the path to
> > > > the sdcard
>
> > > > -then run adb.exe : adb push local_file sdcard/remote_file
>
> > > > -then you should put :  > > > android:name="android.permission.RECORD_AUDIO"> in
> > > > the androidmanifest.xml
>
> > > > -then there is some code to implement which should look like :
> > > > private void startRecord() {
>
> > > >            recorder = new MediaRecorder();
> > > >             recorder.setAudioSource(MediaRecorder.AudioSource.MIC);  
> > > > //ok
> > > so
> > > > I say audio source is the microphone, is it windows/linux microphone
> > > > on the emulator?
>
> > > recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
> > > >             recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
> > > >             recorder.setOutputFile("/sdcard/test.3gpp");
>
> > > >             recorder.prepare();
> > > >             recorder.start();
>
> > > >                 }
>
> > > > -then you should stop with : recorder.stop(); // at some point (I have
> > > > no idea when and where to decide to stop but I haven't searched yet)
>
> > > > -then you should play it.
>
> > > > I have also heard about :
> > >http://code.google.com/intl/fr/android/reference/emulator.html#sdcard
> > > > in this page of the manual (~1/4 of the total scroll

[android-developers] Displaying Text anywhere on the screen Dynamically

2010-01-26 Thread nicolas cosson
Hi, I'd like to display text on the screen on top of a drawable
anytime there is a OnTouch trigger (which is handled).

Is it possible?

I found TextView and TextPaint but neither of these texts will display
itself anywhere in a chaotic fashion, and it won't display itself on
top of a drawable.

see link for an image of what I want.
http://ups.imagup.com/07/1264601491.png

The goal would be to be able to select these object (which graphically
would be represented by the text and the drawable) and do stuff with
it.

Ideally I want to do :
Text t=new Text("hello" , x , y);

Thanks for any information you can provide

-- 
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