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 exceptionthis is the code in recordCode:javax.microedtion.media.MediaException: MUS
and this is the code in player thredCode: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();
i hope u could help ,Code:ByteArrayInputStream recordedInputStream = new ByteArrayInputStream(recordedSoundArray); Player p2 = Manager.createPlayer(recordedInputStream,"audio/x-wav"); p2.prefetch(); p2.start();
thanx

Reply With Quote

