Search code examples
blackberryblackberry-simulator

voice recording and play programatically in blackberry


Is it possible in blackberry to record voice and play it programatically. Please give me some idea the how can we achieve this. Any reference link too if possible.

Thanks in advance.


Solution

  • Try this.

    - Record Code

    Player player = Manager.createPlayer("capture://audio?encoding=amr");
    
    RecordControl recorder = (RecordControl)player.getControl("RecordControl");
    
    recorder.setRecordLocation("file:///SDCard/BlackBerry/Music/recordingFile.amr");
    
    recorder.startRecord();
    
    player.start();
    
    Thread.sleep(5000);
    
    recorder.commit();
    
    player.close();
    

    - Play Code

    Player music = Manager.createPlayer("file:///SDCard/BlackBerry/Music/Musicfile.mp3");
    music.realize();
    music.start();