ContentDescriptor do not accept the pcm?

Hi all

I have the following strange situation: I created player with Datasource to receive the RtpPacket byte array and play with blackberry player. However, to implement this I use SourceStream who must have a few ContentDescriptor:

public class RecvStream implements /*Runnable,*/ PlayerListener {
    private Player mPlayer;
    private SendStream mSendStream;

    private SourceStream mInput= new SourceStream(){
        ContentDescriptor mContentDescriptor=new ContentDescriptor("audio/amr");
         /* (non-Javadoc)
         * @see java.io.InputStream#read(byte[], int, int)
         */
        public int read(byte[] b, int offset, int length) throws IOException {
            int len = 0;
            return len;
        }

        public ContentDescriptor getContentDescriptor() {
            return mContentDescriptor;
        }

        public long getContentLength() {
            return -1;
        }

        public int getSeekType() {
            return SourceStream.SEEKABLE_TO_START;
        }

        public int getTransferSize() {
            return 320;
        }

        public long seek(long where) throws IOException {
            return where;
            //throw new IOException("not seekable");
        }

        public long tell() {
            return 0;
        }

        public Control getControl(String controlType) {
            return null;
        }

        public Control[] getControls() {
            return null;
        }
    };

    public RecvStream(RtpSession session,SendStream sendStream) {
    }

    public void stop() {
        if (mPlayer == null) return;//nothing to stop
        mRunning=false;
        try {
            if (mPlayer.getState() == Player.STARTED) {
                mPlayer.stop();
            }
            if (mPlayer.getState() != Player.CLOSED) {
                mPlayer.close();
            }
        } catch (MediaException e) {
        }
    }

    public void start() {
        mSession.setTimestampClock(new TimestampClock(){
            public int getCurrentTimestamp() {
                return getCurTs();
            }
        });
        try{
            mPlayer = Manager.createPlayer(new DataSource (null) {
                SourceStream[] mStream = {mInput};
                public void connect() throws IOException {
                }

                public void disconnect() {
                }

                public String getContentType() {
                    return mInput.getContentDescriptor().getContentType();
                }

                public SourceStream[] getStreams() {
                    return mStream;
                }

                public void start() throws IOException {
                }

                public void stop() throws IOException {
                }

                public Control getControl(String controlType) {
                    return null;
                }

                public Control[] getControls() {
                    return null;
                }

            });

            mPlayer.addPlayerListener(this);
            mPlayer.realize();
            AudioPathControl  lPathCtr = (AudioPathControl) mPlayer.getControl("net.rim.device.api.media.control.AudioPathControl");
            lPathCtr.setAudioPath(AudioPathControl.AUDIO_PATH_HANDSET);
            mPlayer.prefetch();
            //if ( DeviceInfo.isSimulator() == false) { //only start player on real device
            mPlayer.start();

            //}

        }catch (Throwable e){
        }

    }

    public void playerUpdate(Player arg0, String event, Object eventData) {
        if (event.equals(PlayerListener.BUFFERING_STARTED)){
            mBuffering=true;
        } else if (event.equals(PlayerListener.DEVICE_UNAVAILABLE)) {
            //pausing both player and recorder
            try {
                //already stooped mPlayer.stop();
                 mSendStream.getPlayer().stop();
            } catch (Throwable e) {
            }
        } else if (event == PlayerListener.DEVICE_AVAILABLE) {
            //starting both player and recorder
            try {
                mSendStream.getPlayer().start();
                stop();
                reset();
                start();
            } catch (Throwable e) {
            }
        }
    }

    public int getPlayLevel() {
        if (mPlayer !=null) {
            return ((VolumeControl)mPlayer.getControl("VolumeControl")).getLevel();
        } else {
            return 0;
        }
    }

    public void setPlayLevel(int level) {
        if (mPlayer !=null) {
            ((VolumeControl)mPlayer.getControl("VolumeControl")).setLevel(level);
        }
    }

    public void enableSpeaker(boolean value) {
        if (mPlayer == null) return;//just ignore
        AudioPathControl  lPathCtr = (AudioPathControl) mPlayer.getControl      ("net.rim.device.api.media.control.AudioPathControl");
        try {
            lPathCtr.setAudioPath(value?AudioPathControl.AUDIO_PATH_HANDSFREE:AudioPathControl.AUDIO_PATH_HANDSET);
        } catch (Throwable e) {
        }
    }

    public boolean isSpeakerEnabled() {
        if (mPlayer == null) return false;//just ignore
        AudioPathControl  lPathCtr = (AudioPathControl) mPlayer.getControl("net.rim.device.api.media.control.AudioPathControl");
        return  lPathCtr.getAudioPath()==AudioPathControl.AUDIO_PATH_HANDSFREE;
    }
    public long getPlayerTs() {
        return mPlayerTs;
    }

When I try to write ECM/pcm audio or audio/basic for Simulator ContentDescriptor throws MediaException.As I understand that I did something wrong, but how can I give a pcm for ContentDescriptor entry?

Any ideas?

ThanksMSohm , but I already find solution. For that Datasource accepts the pcm (it's weird), but you must write audio/x-pcm not ECM/pcm audio or audio/basic. Before that he was the exception in time of creating player.

Tags: BlackBerry Developers

Similar Questions

  • IPhone does not accept the code to check for text messages

    II phone does not accept the code verification for the transfer of messages text imac

    Maybe these articles will help:

    Get a verification code and connect with authentication to two factors - Apple Support

    If you don't receive your check or reset email - Apple Support

    If this is not the case, can you explain a little more detail what exactly is your problem?  Or see the 'Contact us' at the bottom of the second article.

  • iPad does not accept the new password for the new internet provider

    Installed new Internet link service - century. IPad will not accept the password written on the modem. How can I connect to wi - fi with this situation?

    Can you connect to the Wi - Fi connection with another? The problem may be with the password. Read this article: If you need help with your Wi-Fi - Support Apple password

  • On my old e-mail account I could insert a list of addresses by putting the list name in the to: my new email account will not accept the list names. How can I fix th

    My old Thunderbird e-mail account has been with Time Warner,
    SC. RR.com. my new second account) is with AT & T, ATT.net.

    In my old account I could give a name to a list of multiple e-mail accounts, put the name of lists at the BBC: and send email to everyone on the list.
    My new account will not accept the name of a list. He insists on the format of a single e-mail account. I tried to create a new list after closing the old account and open the new one, but the results were the same.

    How to make 'list' to work on my new ATT account?

    I'm glad to hear that your problem has been resolved, please select the answer that solved the problem. This will help other users with similar problems more easily find the solution.

    Please contact the Mozilla Support!

  • The "MyNewServerHostname" server did not accept the certificate.

    Hello

    I have a server on a Mac mini with OS X 10.11 and a MacBook pro with OS X 10.11 customer who worked very well in the lab. But to put the server on another network necessary to change the name and the IP with the changeip command-line. Now the customer can not get the schooling profile.

    On the client, I have install the trusted certificate, and then when I install the profile of education get the following failure message:

    The "MyNewServerHostname" server did not accept the certificate.

    I already tell a customer to make clean installation, deleted all the old certificate server, stopped the open directory and destroy the OD with the slapconfig command-line - destroyldapserver. And then create a new OD with new certificates, but always the same message failed. Any idea to fix it?

    After you rename the server, you must create a new profile of certificate and trust. Did you do that?

  • Re: Failed on nine L510 Vista admin password - does not accept the admin pass

    Hi all

    Completely baffled by this one so would appreciate any advice.

    I just bought a new Satellite L510 with vista hard disk installation.

    I went through the installation process long and eventually got to the point where I could configure my admin account and the name of my computer.

    I chose the name of my admin account and typed in the password and confirm the password and named my computer.

    Now when I get to the initial Vista logon screen, it does not accept the password I am entered (and confirmed).

    This can be a problem with caps lock, as the password was all numbers.

    (the password was all numbers and five numbers)

    It, however, gives the correct indication for the password that I entered. It does not accept the password.

    I would be happy even just redo the installation process, but I have no idea how to do this, because I can't even a quick command-line anywhere.

    Help, please!

    It's strange. You can log on using a different user name?

    In any case to run recovery, you either:

    * Press and hold zero during the power upward
    * Press F8 before Windows starts to enter the Windows Start Menu, then run recovery of the option "repair your computer". http://APS2.toshiba-tro.de/KB0/HTD9102IR0000R01.htm

  • Gamepad - resource conflict do not accept the satellite A110

    Satellite A110 do not ACCEPT the JOY STICK. CONFLICT OF RESOURCE WITH THE MOTHER. BOARD OF DIRECTORS

    Hello

    I guess there is a resource conflict because the game port is not available on the device.
    So the joystick device tries to use the resources that are used or reserved for any other device.

    I wanted to use a joystick on my no Toshiba laptop, but it has not been possible.
    It was the same question as on your device. But I was able to use it on the desktop.
    I think that support doesn t use laptop a lot because of miniaturization and mobility Office PC port.

  • System preferences do not accept the admin password

    System preferences panel does not accept the administrator password

    The Prefs system is just an application. Exactly where you try to use the admin password? What is the error you get? Are you sure that the password is correct?

  • Money Plus Deluxe does not accept the product key

    I bought a new computer - I have Money Plus Deluxe on my old computer.  I installed the software on my new computer, but it does not accept the product key.  How to operate?

    Moved from the community involvement Center

    Original title: Money Plus Deluxe

    Hello

    Ask in the silver Forum

    https://social.Microsoft.com/forums/en-us/home?Forum=money

    Don

  • update of sql server 2005 service pack 3 error code 6D9E Windows update security does not accept the update

    update of sql server 2005 service pack 3 error code 6D9E Windows update security does not accept the update

    Hey lasdj,

    Thanks for posting in the Microsoft answers site!

    If you receive Windows Update error 6d9e while installing SQL Server 2005 Service Pack 3 by using Windows Update, it means that the installation folders and directories are compressed or encrypted.

    To fix this problem, make sure the folder locations where you are installing the service pack to aren't compressed or encrypted, or specify a different folder and then run Windows Update again.

    Therefore, remove the compression of the DATA directory and run together to the top again.

    Remove compression from the C:\Program Files\Microsoft SQL Server folder and see if you are able to install the updates without any problem.

    See the links below for more details:

    Windows Update error 6d9e
    http://Windows.Microsoft.com/en-IE/Windows-Vista/Windows-Update-error-6D9E 

    Install SQL Server 2005 and 2008 failures (compressed DATA directory)
    http://blogs.msdn.com/psssql/archive/2009/02/24/SQL-Server-2005-and-2008-Setup-failures-compressed-data-directory.aspx

    I hope this helps!
    Gokul T - Microsoft Support

  • My computer does not accept the print command.

    My computer does not accept the print command.  He always questions me to save a file, I don't want to save a file.  How can I change this?

    Sherimcfalls,

    1. what operating system is installed on the computer?
    2. the problem occurs with any particular application?

    Method 1
    I suggest you try the steps from the following link:

    Printer in Windows problems
    http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows

    Method 2
    Try to set the default printer.

    Change your default printer
    http://Windows.Microsoft.com/en-us/Windows7/change-your-default-printer
    http://Windows.Microsoft.com/en-us/Windows-Vista/change-your-default-printer

  • request for insertion of product key, do not accept the product key code

    computer does not accept the code product key on the underside of the top of the Tower

    Windows Update has nothing to with the upgrade of Windows. Please repost your question in the support forum: http://social.answers.microsoft.com/Forums/en-US/w7install/threads ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Flight Simulator FS9.cfg file does not accept the changes

    I am running Msft FltSim2004 under Windows 7 Professional. I had to make additions to the FS9.cfg file (it takes changes in txt in Notepad). It is a hidden file located in C:\Users\{my name} \AppData\Roaming\Microsoft\FS9. After that I have to make the changes and close the file, and restart FltSim, I still get the error that the change was supposed to eliminate FltSim. When I check FS9.cfg, the change I've made is no longer there.

    I changed all the c:\ folder permissions down to FS9, as well as the permissions in the FS9.cfg file. But it still does not accept the changes. Everything else works fine under Win7. Any suggestions? Thanks in advance for your help.

    Art

    Art,
    Try to copy the file to your desktop (or another folder), and then delete one located in the FS9 folder.  Make the changes to the copied file and simply save it to the new location.  Reopen the case to check the changes remained, and then copy it in the FS9 folder and test.  Let us know the results.
    Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Aspire 5749z who do not accept the windows product key, attached to the back of the laptop

    I installed Windows 10 House. When I went to enter the enclosed code error codes and not accept the key and activate windows 10

    you need to upgrade your version of windows to windows 10 first, then you can do a clean install.

    you don't need to enter any 10 windows product key during installation (if you did the upgrade first).

    Windows 10 will not accept any product key from older versions of windows if you do a clean install, you must buy a windows retail 10.

  • Error in partition Acer Iconia B1 does not accept the update.

    My new Acer iconia b1 - a71 16 GB does not accept the OTA update in the system start menu! He accepts, and download the update. After that is give me to reboot and install. And after - installation under the start menu in the system stops

    ERROR:-invalid partition setting
    17: 238e8000:888e8000 of fat
    Instalation aborted.

    The Tablet is clean and the. I tested it without SD card inside. I even try with the original OS rom in the Acer support site - and still the same error! Can anyone describe it is hardware problem to return to the supplayer or how to fix this problem?
    Can you help me?

    A hotfix is available to resolve the error of invalid Partition. In addition, we have created a few video tutorials that will help guide you through the installation of the patch.

    Download the patch

    Iconia B1 - A71, install the USB 2.0 driver - video tutorial

    Iconia B1 - A71 error invalid when updating Android (FAST) partition - video tutorial

    Iconia B1 - A71 error invalid when updating Android (FULL) partition - video tutorial

Maybe you are looking for