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)
private class PlayTask extends AsyncTask { private String TAG = PlayTask.class.getName(); @Override protected void onPreExecute() { super.onPreExecute(); controlStatus.setText("Playing..."); } @Override protected Void doInBackground(WavItem... wavItem) { byte[] audioData = wavItem[0].getAudioData(); int frequency = wavItem[0].getFrequency(); int channelConfiguration = wavItem[0].getChannelConfiguration(); int audioEncoding = wavItem[0].getAudioEnconding(); int bufferSize = AudioTrack.getMinBufferSize(frequency, channelConfiguration, audioEncoding); short blockAlign = wavItem[0].getBlockAlign(); /* Byte array to read the samples from the input stream.*/ byte[] audioDataChunk = new byte[bufferSize]; int readed = 0; int duration = 0; try { DataInputStream dis = new DataInputStream(new ByteArrayInputStream(audioData)); AudioTrack audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, frequency, channelConfiguration, audioEncoding, bufferSize*8, AudioTrack.MODE_STREAM); audioTrack.play(); while(isPlaying && dis.available() > 0){ int i = 0; while(dis.available() > 0 && i < audioDataChunk.length){ audioDataChunk[i] = dis.readByte(); i++; } readed = audioData.length - dis.available(); /* Compute duration*/ duration = readed/blockAlign/frequency; publishProgress(new Integer(duration),new Integer(readed)); audioTrack.write(audioDataChunk, 0, audioDataChunk.length); } /* No more data to play or stop pressed.*/ // Close the stream. dis.close(); audioTrack.flush(); // Stop playing audio data. audioTrack.stop(); // Release AudioTrack resources. audioTrack.release(); // Set AudioTrack object to null audioTrack = null; } catch (Exception e) { if (e.getMessage() != null){ Log.e(TAG, "doInBackground(): "+e.getMessage()); } else{ Log.e(TAG, "doInBackground(): Playeback failed"); } } return null; } @Override protected void onProgressUpdate(Integer... values) { super.onProgressUpdate(values); String timeLength=String.format("%02d:%02d:%02d", values[0]/3600, (values[0]%3600)/60, (values[0]%60)); trackDuration.setText(timeLength); trackPlaybackProgress.setProgress(values[1]); } @Override protected void onPostExecute(Void result) { super.onPostExecute(result); controlStatus.setText("Stopped"); } }