如果用户按下开始按钮,我有一个短代码可以将录制的音频实时传输到扬声器。在他按下停止按钮后,缓冲的音频应该保存在一个 mp3 文件中。该文件已创建,但它是空的。如果我尝试播放文件,我听不到任何声音。
public class MainActivity extends Activity {
boolean m_stop = true;
AudioTrack m_audioTrack;
Thread m_noiseThread;
static final int bufferSize = 200000;
AudioRecord arec;
FileOutputStream os = null;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void onStartStopClicked(View v)
{
Button StartButton = (Button)findViewById(R.id.StartStop);
if(m_stop) {
start();
} else {
stop();
}
}
Runnable m_noiseGenerator = new Runnable()
{
public void run()
{
String filepath = Environment.getExternalStorageDirectory().toString();
os = new FileOutputStream(filepath + "/test.mp3");
int buffersize1 = AudioRecord.getMinBufferSize(11025, …Run Code Online (Sandbox Code Playgroud) 标准的管理工具栏按钮可以为您提供消息.例如:"真正删除"消息或某事......
JToolBarHelper::deleteList('Do you wanna really delete?', 'controller.delete');
Run Code Online (Sandbox Code Playgroud)
这也适用于自定义按钮吗?在文档中没有参数.http://docs.joomla.org/JToolBarHelper/custom
Joomla有另一种解决方案吗?向用户显示消息并在确认后执行我的代码!那可能吗?
抱歉我的英文不好:)谢谢!