import javax.microedition.lcdui.Alert;

import javax.microedition.lcdui.Command;

import javax.microedition.lcdui.CommandListener;

import javax.microedition.lcdui.Display;

import javax.microedition.lcdui.Displayable;

import javax.microedition.media.Manager;

import javax.microedition.media.Player;

import javax.microedition.media.control.RecordControl;

import javax.microedition.midlet.MIDlet;

public class SaveCapturedAudioMIDlet extends MIDlet implements CommandListener {

private Display display = null;

private Alert alert = new Alert("Message");

private Command exitCommand = new Command("Exit", Command.EXIT, 1);

private Player capturePlayer = null;

private Player playbackPlayer = null;

private RecordControl rControl = (RecordControl) capturePlayer.getControl("javax.microedition.media.control.RecordControl");

public SaveCapturedAudioMIDlet() {

display = Display.getDisplay(this);

alert.setTimeout(Alert.FOREVER);

alert.setString("Capturing for 10 seconds.");

alert.addCommand(exitCommand);

alert.setCommandListener(this);

try {

capturePlayer = Manager.createPlayer("capture://audio");

if (capturePlayer != null) {

capturePlayer.realize();

display.setCurrent(alert);

if (rControl == null)

&n

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐