|
|
|
Как сохранить звук в Netbeans Mobile Application
|
|||
|---|---|---|---|
|
#18+
Здравствуйте! Вопрос: как в Netbeans Mobile Application записать звуки, произносимые в микрофон. В смысле как продиктовать и после воспроизвести я знаю, а как на жестком диске их сохранить? вот такой код я использую, но он только для воспроизведения... public class CaptureThread extends Thread implements PlayerListener { ByteArrayOutputStream output; private Player player; /** Creates a new instance of CaptureThread */ public CaptureThread(ByteArrayOutputStream output) { this.output = output; } public void run(){ try { // Create a Player that captures live audio. player = Manager.createPlayer("capture://audio"); player.realize(); // Get the RecordControl, set the record stream, // start the Player and record for 5 seconds. RecordControl rc = (RecordControl)player.getControl("RecordControl"); rc.setRecordStream(output); rc.startRecord(); player.start(); Thread.currentThread().sleep(5000); rc.commit(); player.close(); reset(); } catch (IOException ioe) { } catch (MediaException me) { } catch (InterruptedException ie) { } } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.03.2006, 14:41 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=744&tid=2149967]: |
0ms |
get settings: |
7ms |
get forum list: |
9ms |
check forum access: |
7ms |
check topic access: |
7ms |
track hit: |
27ms |
get topic data: |
7ms |
get forum data: |
2ms |
get page messages: |
19ms |
get tp. blocked users: |
1ms |
| others: | 227ms |
| total: | 313ms |

| 0 / 0 |
