powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Java [игнор отключен] [закрыт для гостей] / Как сохранить звук в Netbeans Mobile Application
1 сообщений из 1, страница 1 из 1
Как сохранить звук в Netbeans Mobile Application
    #33592874
zeisig
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Здравствуйте!
Вопрос: как в 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) { }

}
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / Java [игнор отключен] [закрыт для гостей] / Как сохранить звук в Netbeans Mobile Application
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]