Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can create Visualizer for android 2.3.3 audio recoder
    primarykey
    data
    text
    <p>Visualizer Mediaplayer link</p> <pre><code>public void link(MediaPlayer player) { if(player == null) { throw new NullPointerException("Cannot link to null MediaPlayer"); } // Create the Visualizer object and attach it to our media player. mVisualizer = new Visualizer(player.getAudioSessionId()); 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); // Enabled Visualizer and disable when we're done with the stream mVisualizer.setEnabled(true); } </code></pre> <p>How can I create the Visualizer for android Audio Recorder 2.3.3? I'd like to be able to do something like this:</p> <pre><code>public void link(AudioRecorder recorder) { // Create the Visualizer object and attach it to our media player. mVisualizer = new Visualizer(recorder.getAudioSessionId()); </code></pre> <p>But my problem is that <code>recorder.getAudioSessionId()</code> method only is available in API level 16 (Jellybean) and above, while I'm targeting Android 2.3.3 (Gingerbread). Any suggestions for alternatives?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload