question

Stefan Pledl avatar image
Stefan Pledl asked

Visualizer returns 0 arrays

The visualizer always returns 0 arrays in onWaveFormDataCapture and onFftDataCapture. I tried to set the mediaplayer audiosessionid to 0 and I tried to set the visualizer audiosessionid to 0. Visualizer: http://developer.android.com/reference/android/media/audiofx/Visualizer.html code on pastebin for readability: http://pastebin.com/TchCxwvr code: public void link(int audioSessionId){ //audioSessionId is from mediaplayer.getAudioSessionId try { mVisualizer = new Visualizer(audioSessionId); } catch (Exception e) { L.e("Error enabling visualizer!" + e.getMessage()); return; } mVisualizer.setEnabled(false); mVisualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1]); // Pass through Visualizer data to VisualizerView Visualizer.OnDataCaptureListener captureListener = new Visualizer.OnDataCaptureListener() { @Override public void onWaveFormDataCapture(Visualizer visualizer, byte[] bytes,int samplingRate) { updateVisualizer(bytes); } @Override public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) { updateVisualizerFFT(bytes); } }; mVisualizer.setDataCaptureListener(captureListener, Visualizer.getMaxCaptureRate() / 2, true, true); } public void updateVisualizer(byte[] bytes) { mBytes = bytes; for(int i = 0; i < bytes.length; i++) { if (bytes[i]!=-128) { L.e( "Found Nonzero sample "+bytes[i]); break; } } invalidate(); } Message was edited by: droid
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Stefan Pledl avatar image
Stefan Pledl answered
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
This issue has fixed in Fire OS 4 and your sample displays the visualizer on all our 4th generation Fire tablets. We have reported the issue to our internal team to look into this issues for our earlier generation tablets. Thanks for bringing this to our attention.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Stefan Pledl avatar image
Stefan Pledl answered
It's a necessary feature for my app, I guess you won't give an ETA for the update on the FireTV, but still. ETA ? :-)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Stefan Pledl avatar image
Stefan Pledl answered
When will this be fixed on Fire TV ?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Stefan Pledl avatar image
Stefan Pledl answered
...
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.