[android-developers] Re: no audio from bluetooth sco earpiece

2012-07-05 Thread the_edge123
I found the solution :-)
I posted it on SO:
 
http://stackoverflow.com/questions/7212783/android-playing-sound-over-sco-bluetooth-headset/11348952#11348952

-- 
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: no audio from bluetooth sco earpiece

2011-12-30 Thread the_edge123

Is there a way to dig into the android source code to track this
issue ?

-- 
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] no audio from bluetooth sco earpiece

2011-12-26 Thread the_edge123
Hello,

I want to play a sample file to test the bluetooth sco connection on
Android 2.2. The device is an earpiece (Nokia BH-701).
The problem is that I can hear and see that the SCO connection is Ok
but I can not hear the sample audio (mono,8kHz, 16 bits).
The connection seems to be established twice and AudioFlinger shows a
blocking write msg.
Did I miss something ?
--
extract of logs:
12-26 16:45:35.821: I/ActivityManager(1964): Starting activity: Intent
{ act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x1000
cmp=com.rider/.RiderBlueToothActivity }
12-26 16:45:36.261: D/ScoSocket(2038): connect()
android.bluetooth.ScoSocket@43ef8eb0
12-26 16:45:36.261: I/bluetooth_ScoSocket.cpp(2038): getScoType Nokia
BH-701 - 0x0
12-26 16:45:36.266: I/bluetooth_ScoSocket.cpp(2038): Connecting to
socket
12-26 16:45:36.311: D/brd(12018): Audio SCO state: 1
12-26 16:45:36.311: I/brd(12018): SCO_AUDIO_STATE_CONNECTED
12-26 16:45:36.321: I/StagefrightPlayer(1895): setDataSource('/mnt/
sdcard/Sounds/tmpAmr/lathe.mp3')
12-26 16:45:36.336: D/AudioHardware(1895): AudioStreamOutALSA::write:
AudioHardware pcm playback is exiting standby.
12-26 16:45:36.336: D/AudioHardware(1895): openPcmOut_l() mPcmOpenCnt:
0
12-26 16:45:36.421: W/AudioFlinger(1895): write blocked for 86 msecs,
32 delayed writes, thread 0xc820
12-26 16:45:36.486: I/bluetooth_ScoSocket.cpp(2038): SCO socket
connected (outgoing)
12-26 16:45:36.586: D/brd(12018): Audio SCO state: 1
12-26 16:45:36.591: I/brd(12018): SCO_AUDIO_STATE_CONNECTED
12-26 16:45:36.596: I/StagefrightPlayer(1895): setDataSource('/mnt/
sdcard/Sounds/tmpAmr/lathe.mp3')
12-26 16:45:41.986: D/dalvikvm(2296): GC_EXPLICIT freed 1469 objects /
70512 bytes in 355ms
12-26 16:45:43.841: D/AudioHardware(1895): AudioHardware pcm playback
is going to standby.
12-26 16:45:43.881: D/AudioHardware(1895): closePcmOut_l()
mPcmOpenCnt: 1
12-26 16:45:49.051: D/dalvikvm(12018): Calling exit(1)
--
The sample code is:
in an Activity:
IntentFilter l_intentFilter = new
IntentFilter(AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED);
rbmBroadcastReceiver=new MyBroadcastReceiver();
this.getApplicationContext().registerReceiver(rbmBroadcastReceiver,l_intentFilter,null,null);
rbmAudioManager = (AudioManager)
getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
rbmAudioManager.startBluetoothSco();

and in MyBroadcastReceiver:
public void onReceive(Context arg0, Intent arg1)
{
if
(action.equalsIgnoreCase(AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED))
{
int l_state = 
arg1.getIntExtra(AudioManager.EXTRA_SCO_AUDIO_STATE,
-1);
if (AudioManager.SCO_AUDIO_STATE_CONNECTED == l_state)
{

Log.i(brd, SCO_AUDIO_STATE_CONNECTED);
File l_tstFile = new File(/mnt/sdcard/Sounds/tmpAmr/lathe.mp3);
Uri myUri = Uri.fromFile(l_tstFile); // initialize Uri
here
MediaPlayer mediaPlayer = new MediaPlayer();
 
mediaPlayer.setAudioStreamType(AudioManager.STREAM_VOICE_CALL);
try
{
mediaPlayer.setDataSource(arg0, myUri);
mediaPlayer.prepare();
mediaPlayer.start();

} catch (IllegalArgumentException e)
{
// TODO Auto-generated catch block
Log.i(brd, IllegalArgumentException);
e.printStackTrace();
} catch (SecurityException e)
{
// TODO Auto-generated catch block
Log.i(brd, SecurityException);
e.printStackTrace();
} catch (IllegalStateException e)
{
// TODO Auto-generated catch block
Log.i(brd, IllegalStateException);
e.printStackTrace();
} catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}

-- 
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: OpenGL ES 2.0 for Android

2011-12-26 Thread the_edge123
On Dec 26, 11:05 am, bob b...@coolfone.comze.com wrote:
 What is the best way to learn OpenGL ES 2.0 for Android?
What kind of tutorial are you looking for ? are you a beginner ?
What did you already find ?

-- 
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] Voice recognition (buffered speech)

2011-09-12 Thread the_edge123
Hello,

I want to decode a buffered speech to text. Is it possible to send it
to a voice recognizer ?
If not, is it possible to use the jsapi ?

Thanks in advance,
Fabien

-- 
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: connection to bluetooth earpiece

2011-09-02 Thread the_edge123


On Aug 31, 3:57 am, James 030440...@163.com wrote:
 You never need to do this. If you want to transfer music toearpiece,
 You just need to start a intent to let user enable BT and connect to
 theearpiece.
 This is the BT A2DP protocal which android already implemented. BTW, I
 think a normal server socket could not work for you.
The pb is that I'm stuck to Android 2.3.3
I don't have access to the BT A2DP class :-(

-- 
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] connection to bluetooth earpiece

2011-08-30 Thread the_edge123
Hello,

I want to connect my app to a BT earpiece so that the sound coming
from the mike is heard on the phone and the sound played by the app is
heard in the BT earpiece.
My approach is to open a bluetooth server socket. Once the connection
is established, the input stream would be played by a mediaplayer and
the output stream would be sent as-is to the earpiece.

Any advice ?

-
Fabien

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