| Reply | « Previous Thread | Next Thread » |
|
I am working on nokia 3110 handset. I am trying make application to to record and play sound. I am successfully recording the sound but while playing recorded sound it is giving javax.microedition.media.Mediaexception:Deviceerror. The program is running fine on emulator. I am using content type as audio/x-amr.Could anybody suggest any way????
Thanks Akhil |
| gupta.akhil21 |
| View Public Profile |
| Find all posts by gupta.akhil21 |
|
Are you stopping the other players before trying to playback the recording?
http://www.forum.nokia.com/document/...8E867E73B.html Hartti |
|
yes I am stopping the player which is doing recording before calling playback facility I am also enclosing my code.
private void recordtofile() { try{ store = RecordStore.openRecordStore("voicestore",true); p= Manager.createPlayer("capture://audio"); p.realize(); rc = (RecordControl)p.getControl("RecordControl"); output = new ByteArrayOutputStream(); rc.setRecordStream(output); rc.startRecord(); p.start(); Thread.currentThread().sleep(10000); p.stop(); rc.stopRecord(); rc.commit(); byte[] b = output.toByteArray(); store.addRecord(b,0,b.length); InputStream is = new ByteArrayInputStream(b); player = Manager.createPlayer(is, "audio/x-wav"); player.prefetch(); player.start(); mDisplay.setCurrent(mMainScreen); } catch(Exception e) {showException(e); } } |
| gupta.akhil21 |
| View Public Profile |
| Find all posts by gupta.akhil21 |
|
your code says that you try to playback x-wav but you say in your first post that you are using x-amr? Which one you really recording?
Hartti |
|
I have tried using both but nothing is working. It is giving same error in both.
Akhil |
| gupta.akhil21 |
| View Public Profile |
| Find all posts by gupta.akhil21 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|