×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    27

    i can't play sound in nokia emulitar and real device

    hi
    i tried for the past days to play sound after recording using the code below it work in WTK emulitar but didn't work in nokia emulitar (s40 5th edtion sdk FP1) and real device (5310,6300)when i try to play i get this exception
    Code:
    javax.microedtion.media.MediaException: MUS
    this is the code in record
    Code:
    byte[] recordedSoundArray = null;
    p = Manager.createPlayer("capture://audio");
    p.realize();
    RecordControl rc = (RecordControl)p.getControl("RecordControl");
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    rc.setRecordStream(output);
    rc.startRecord();
    //start player
    p.start();
    p.realize();
    form.append("recording...\n");
    form.removeCommand(play);
    // record for 5 seconds
    Thread.currentThread().sleep(5000); 
    rc.commit();
    p.stop();
    p.close();
    recordedSoundArray = output.toByteArray();
    and this is the code in player thred


    Code:
    ByteArrayInputStream recordedInputStream = new ByteArrayInputStream(recordedSoundArray);
    Player p2 = Manager.createPlayer(recordedInputStream,"audio/x-wav");
    p2.prefetch();
    p2.start();
    i hope u could help ,
    thanx

  2. #2
    Registered User
    Join Date
    Sep 2008
    Posts
    27

    Re: i can't play sound in nokia emulitar and real device

    ok guys it worked using audio/amr and anther thing i like to say that the code that worked in real device i try it in emulator, after recording in emulator i play the recording voice but i hear the "nokia tone" not my voice so it's little confusing .
    thanks ..

Posting Permissions

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