Enabling audio in emulator

by PAS » Tue, 07 Oct 2008 08:14:17 GMT


Sponsored Links
 Since I found nothing about this while looking, I thought I would
document my findings here.

I had some trouble getting audio to work in the Android emulator.
Eclipse was displaying the following:
    [2008-10-06 16:18:12 - Emulator] emulator: warning: opening audio
output failed

Having a look at the emulator startup options for Android 1.0 SDK,
Release 1:
     http://code.google.com/android/reference/emulator.html #startup-options

...I found some of the Media ones are not correct . Even the self
documentation inside emulator -help-audio is not correct:
    $ emulator -useaudio
    invalid command-line parameter: -useaudio
    $ emulator -help-audio-out
    unknown option: -audio-out
    $ emulator -help-audio-in
    unknown option: -audio-in

I tried the obvious, but got the same error I was getting through
Eclipse (I guess alsa is the default)
    $ emulator -audio alsa
    emulator: warning: opening audio output failed

The only way I got sound working was to run:
    $ emulator -audio oss

Please note that while the emulator is running, you will not be able
to use other audio apps (at least I couldn't).

I hope that helps someone out there. If I have missed something,
please let me know.

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



Enabling audio in emulator

by GUS » Tue, 07 Oct 2008 09:32:00 GMT


 Nice. But I think your audio doesnt work normaly becouse some other
program on your machine is blocking the audio devices. Fortunatelly,
my audio works fine.

Thx anyway.



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


Sponsored Links


Enabling audio in emulator

by Selmi » Thu, 30 Oct 2008 07:03:04 GMT


 i had same problem, but when i used lsof to find out what is
accessing /dev/snd i found that nothing does..so i don't know what
could block soundcard
emulator -audio oss fixed problem for me

also i found that if i have rhytmbox  playing and i close emulator it
kills sound and make rhytmbox freeze. i would guess that emulator acts
very aggresive with sound




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



Other Threads

1. Implementing BaseInputConnection using SpannableStringBuilder

I'm attempting to work out how BaseInputConnection works using the
SpannableStringBuilder as the Editable and have this code:

public class MyInputConnection extends BaseInputConnection {

        private static final String DEBUG_TEST = new String("ABCDEF");
        private SpannableStringBuilder mEditable;

        public CrosswordInputConnection(View targetView, boolean fullEditor)
{
                super(targetView, fullEditor);
        }

        public Editable getEditable() {
        if (mEditable == null) {
            mEditable = (SpannableStringBuilder)
Editable.Factory.getInstance().newEditable(DEBUG_TEST);
            }
        return mEditable;
    }

        public boolean commitText(CharSequence text, int newCursorPosition) {
                mEditable.append(text);
                return true;
        }

        public ExtractedText getExtractedText(ExtractedTextRequest request,
int flags) {
                ExtractedText ext = new ExtractedText();
                ext.text = mEditable.toString();
                return ext;
        }
}

What I'm having trouble understanding is where the cursor is set in
the Editable/SpannableStringBuilder.  The mEditable.mText member
contains 'ABCDEF' (as per the getEditable call).  When the soft
keyboard pops up, and I press 'x' this breaks into the commitText()
method above.  The mEditable.append(text) (of the 'x' char) applies
the 'x' to mEditable.mText[0], rather than at the end (which is what
one would expect with an append() call).  So, clearly I'm missing
something here with regards to the placement of a cursor or somesuch
within the Editable object.  I'd appreciate a push in the right
direction.

2. ATTENTION ANDROID TEAM: Take back control of Android.

-- 

3. ATTENTION ANDROID TEAM: Take back control of Android.

4. LIVE BLOG untuk Gathering !

5. Preparing for Droid OpenGL issues

6. EditText := size of the text content

7. Permission Denied when using geo fix