Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package com.mixer01; import java.io.BufferedOutputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; import android.media.AudioFormat; import android.media.AudioRecord; import android.media.MediaRecorder; import android.media.AudioRecord.OnRecordPositionUpdateListener; import android.util.Log; public class Recorder implements OnRecordPositionUpdateListener { private static final int encoding = AudioFormat.ENCODING_PCM_16BIT; public static final int frequencies[] = {44100,22050,11025,8000}; public int frequency = Recorder.frequencies[0]; public int channels = AudioFormat.CHANNEL_CONFIGURATION_MONO; private int buffer_size; public boolean isProcessing; private String filename; private OutputStream os; private BufferedOutputStream bos; private DataOutputStream dos; private byte[] buffer; private AudioRecord recorder; public Object record_finished = new Object(); public Recorder( String filename ) { try { this.filename = filename; } catch (Exception e) { Log.e("com.mixer01.Recorder", e.toString()); } } public void start() { isProcessing = true; super.start(); } /** * Create AudioRecord object with specified frequency * @return */ private AudioRecord createRecorder() { AudioRecord res = null; try { // Create a new AudioRecord object to record the audio. buffer_size = AudioRecord.getMinBufferSize(frequency, channels, encoding); res = new AudioRecord( MediaRecorder.AudioSource.MIC, frequency, channels, encoding, buffer_size); } catch (Exception e) { Log.e("com.mixer01.Recorder:createRecorder", e.toString()); } return res; } private void initOutputFile() throws Exception { File file = new File(filename); // Delete any previous recording. if (file.exists()) file.delete(); // Create the new file. file.createNewFile(); // Create a DataOuputStream to write the audio data into the saved file. os = new FileOutputStream(file); bos = new BufferedOutputStream(os); dos = new DataOutputStream(bos); } private void closeOutputFile() throws Exception { dos.close(); bos.close(); os.close(); } public void startRecord() { try { isProcessing = true; initOutputFile(); int pos = 0; recorder = null; while (recorder == null) { frequency = frequencies[pos]; recorder = createRecorder(); pos++; if ( pos >= frequencies.length ) { // that's end, no more variants :( break; } } if (recorder == null) { throw new Exception("Can't create AudioRecord object"); } buffer = new byte[buffer_size]; recorder.setRecordPositionUpdateListener(this); recorder.setPositionNotificationPeriod(buffer_size/2); recorder.startRecording(); int readed = recorder.read(buffer, 0, buffer_size); dos.write(buffer, 0, readed); } catch (Exception e) { Log.e("com.mixer01.Recorder:startRecord", e.toString()); } } public void stopRecorder() { try { isProcessing = false; if ( recorder != null ) { recorder.stop(); recorder.release(); recorder = null; } //this.start(); } catch (Exception e) { Log.e("com.mixer01.Recorder:stopRecorder", e.toString()); } } //------------------------------------------------------------------------------------------------------- // OnRecordPositionUpdateListener routines //------------------------------------------------------------------------------------------------------- public void onMarkerReached(AudioRecord arg0) {} public void onPeriodicNotification(AudioRecord arg0) { try { int readed = recorder.read(buffer, 0, buffer_size); dos.write(buffer, 0, readed); Log.i("OnPeridoc", "buf[0]="+buffer[0]); if (!isProcessing) { closeOutputFile(); synchronized (record_finished) { record_finished.notify(); } } } catch (Exception e) { Log.e("com.mixer01.Recorder:onPeriodicNotification", e.toString()); } } }