Play custom audio format ?

by Derek » Wed, 05 Nov 2008 06:58:03 GMT


Sponsored Links
 Hi all,

Thanks the MediaPlayer, it's possible to play MP3 and OGG. However,
how can we play other audio formats ? We have many audio decoders in
Java (jSpeex, Monkey Audio ...) that can convert (on fly) an encoded
audio stream to PCM stream. It means that we can have an PCM
InputStream but we don't see any method with InputStream as parameter
in MediaPlayer class ?

Would it be possible ?

Thanks.
--~--~---------~--~----~------------~-------~--~----~



Play custom audio format ?

by David Given » Wed, 05 Nov 2008 19:41:31 GMT


 

[...]

This seems not to be really possible right now.

It *is* possible to hack things together that you can do this --- for
example, you can create a local socket, tell the MediaPlayer to stream
from the socket, and then write data to the other end --- it's very slow
and Dalvik isn't really up to the task of synthesising audio data on the
fly, so the results are very unsatisfactory.

Hopefully we'll get more codecs in a future version...

-- 
David Given
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Play custom audio format ?

by Guillaume Perrot » Wed, 05 Nov 2008 21:45:02 GMT


 You can also play audio files which uses the amr audio codec (amr,
m4a).





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. glReadPixels() with transparent background

Hi everyone.

I want to use glReadPixels() to make new texture from current
displayed image.
But alpha value returned from glReadPixels() is always 255,
so I can't make texture with transparency.

Here is a part of my code.
(in GLSurfaceView.Renderer's onSurfaceCreated())

gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_ALPHA_BITS);

object0.draw(gl);
object1.draw(gl);

x = y = 0;
texture_width = texture_height = 128;

ByteBuffer pixels = ByteBuffer.allocate(texture_width * texture_height
* 4);
pixels.order(ByteOrder.nativeOrder());
gl.glReadPixels
(x,y,texture_width,texture_height,GL10.GL_RGBA,GL10.GL_UNSIGNED_BYTE,
pixels);

int[] textureNo = new int[1];
gl.glGenTextures(1, textureNo, 0);
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureNo[0]);
gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, ts, ts, 0,
GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, pixels);

//end

RGB value is OK, but Alpha value is always 255, regardless of the 4th
argument of glClearColor and object's transparent region is filled
with glClearColor()'s RGB value.

Is there any way to make texture with transparency from current
displayed image?

Thanks for your help.

-- 

2. Problems updating my app on Android Market and switching to copy protection

Looks like there are some bugs outstanding:
http://code.google.com/p/android/issues/detail?id=2047
http://code.google.com/p/android/issues/detail?id=2263

Also if you search this group for "copy protection" there are people
reporting/discussing issues regarding changing the copy protection
setting once an applicaton has already been installed.

Looks like it does not work at the moment. Let me/us know if you find
a work around.

--
RichardC




-- 

3. Event keycodes different from keyboard inputs.

4. Moving objects by touch..

5. Maybe Google can learn a thing or two from even BlackBerry?

6. Run ADB client on diff PC than daemon

7. Mock Framework for Android Testing