×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    54

    Series 40 6th edition and Manager.createPlayer

    Hi every one!
    I am encountering one problem. In my application, I use Manager.createPlayer("capture://audio") to record the voice. It is clearly working with the Series 40 5th FP1. When I try to use with Series 40 6th edition ,it shows cannot create player for encoding: amr. So I tried to use pcm for encoding . It show the same error message "Cannot create player for encoding : amr". So I tried to check the Series 40 6th edition can support audio encoding or not with Media Sampler example from Nokia wiki. Series 40 6th Edition can support audio encoding and supported encoding is amr.

    Please give me some instruction why cannot trigger the Manager.createPlayer?

    With regards,
    Thanks you
    Sweet Sweet24

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Series 40 6th edition and Manager.createPlayer

    Hello Sweet Sweet24,

    could you provide your code or ideally the entire MIDlet for testing this issue please?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    54

    Re: Series 40 6th edition and Manager.createPlayer

    Hi r2j7!
    Sorry for late replying! I cannot send my entire midlet but I can send another testing midlet. For using this midlet, I also get the error for record control error. This midlet can also run on the Series 40 5th edition fp1.

    Thanks you,
    With regards,

    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    import javax.microedition.media.control.RecordControl;

    public class PlayerMidlet extends MIDlet {
    private Form form;
    private Player player;
    private RecordControl recordControl;
    private ByteArrayOutputStream out;
    public PlayerMidlet(){
    form = new Form("Recording");
    showVoiceRecorder();
    }
    public void startApp() {
    Display.getDisplay(this).setCurrent(form);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
    private void showVoiceRecorder() {
    Thread t = new Thread()
    {
    public void run()
    {
    try {

    player = Manager.createPlayer("capture://audio");
    player.realize();
    recordControl = (RecordControl) player.getControl("RecordControl");
    out = new ByteArrayOutputStream();
    recordControl.setRecordStream(out);
    recordControl.startRecord();
    player.start();
    Thread.sleep(5000);
    player.stop();
    recordControl.stopRecord();
    recordControl.commit();
    player.close();
    form.append("length");
    } catch (InterruptedException ex) {
    ex.printStackTrace();
    form.append(ex.getMessage());
    } catch (IOException ex) {
    ex.printStackTrace();
    form.append(ex.getMessage());
    } catch (MediaException ex) {
    ex.printStackTrace();
    form.append(ex.getMessage());
    }

    }

    };
    t.start();
    }

    }

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Series 40 6th edition and Manager.createPlayer

    Hello Sweet Sweet24,

    unfortunately this feature cannot be tested using Series 40 6th Ed. SDK emulator, which has been defined in the release notes http://www.forum.nokia.com/info/sw.n...ase_Notes.html under 'Known issues and limitations' as follows:

    9. Metadata control, frame positioning, record control, and video control APIs in MMAPI (JSR-135) do not work in the emulator, please use the phone for this testing.

    Regards,
    r2j7
    Last edited by r2j7; 2009-01-02 at 20:42.
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

Similar Threads

  1. Replies: 3
    Last Post: 2009-02-10, 12:04
  2. MIDI Sound problem (J2ME / Series 60)
    By JPapke in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2004-10-29, 08:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×