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 ?


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


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,


Other Threads

1. Unable to call SOAP webservice using KSOAP2

Hi All,

Please help me. Am trying to call a .net webservice from android.... I
have done the emualtor proxy settings and am able to access the
internet on the emulator .... but when i try to access the wsdl file
from my android program am unable to do it... please help me....

Here is the code which am using to call the webservice....

The wsdl just returns HelloWorld string with out accepting any input

class WebServiceClient implements Runnable
    private static final String SOAP_ACTION = "
    private static final String METHOD_NAME = "HelloWorld";
    private static final String NAMESPACE = "
    private static final String URL = "

        public void run() {
                // TODO Auto-generated method stub

                Log.i("RUN METHOD","Inside the run method");

                Log.i("RUN METHOD","End of run method");


        public void connect()
                SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

                Log.i("CONNECT METHOD","Inside the connect method");

                SoapSerializationEnvelope envelope = new
                envelope.dotNet = true;

                Log.i("CONNECT METHOD","Inside the connect method 2");


                Log.i("CONNECT METHOD","Inside the connect method 3");

                HttpTransportSE androidHttpTransport = new HttpTransportSE

                Log.i("CONNECT METHOD","Inside the connect method 4");

                try {

                        Log.i("CONNECT METHOD","Inside the connect method 5");

              , envelope);
                        Log.i("CONNECT METHOD","Inside the connect method
                        SoapObject resultsRequestSOAP = (SoapObject)
                        Log.i("CONNECT METHOD","Inside the connect method
                       // Vector XXXX = (Vector)
resultsRequestSOAP.getProperty("[Data element name]");

                        Log.i("CONNECT METHOD","Inside the connect method

                            Object result = envelope.getResponse();
                        } catch(Exception E) {
                                Log.i("ERROR IS",E.toString());



I get an error in this line, envelope);

I have also added the following attributes to the AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET"></uses-

I always get the  following error.....

request time failed: The operation
timed out

While trying to access the wsdl file with the xml rpc client i was
able to connect to the wsdl file using the following lines

                                client = new DefaultHttpClient();

                HttpHost proxy = new HttpHost("proxyname",port number,"http");

(ConnRoutePNames.DEFAULT_PROXY, proxy);

is there any similar proxy settings for the above code which i have
posted..... Please help i have been struggling for almost 3 weeks


2. Working on x86

Hi to everyone.

I'm a beginner with android, so i'm following all the steps in the dev
giude and so on.
At the moment,
 I downloaded the sdk 1.5,
 installed ADT plug-in for eclipse,
got the source code (repo sync),
used "make" to build the code.

NOW I'd like to make android running on the desktop i'm using (x86,
ubuntu 8.1).

What should I do to begin?
If it's not possible to run on my device, how can i set the emulator
for an x86 configuration?


3. how to add some key actions from physical keyboard to androi


5. Is there any way to start a new activity from a service.

6. How To Load Previous Activity Which Is Running In Background

7. moving from one screen to another