SoundManager2 WaveFormData and PeakData returns 0

74 Views Asked by At

i'm trying to setup the SoundManager2 with WaveFormData and PeakData. i have enabled everything as per the docs but SM Object still returns 0 values even while a sound is playing. Any idea why ?

    soundManager.url = 'swf/';
    soundManager.flashVersion = 9;
    soundManager.useHTML5Audio = true;
    soundManager.debugMode = false;
    soundManager.useHighPerformance = true;
    soundManager.useFastPolling = true;
    soundManager.usePeakData = true;
    soundManager.useWaveformData = true;
    soundManager.useEqData = true;

The image is the output of the WaveFormData Property and PeakData Property

Any idea why this is happening ?

2

There are 2 best solutions below

1
Sithira On
    soundManager.url = 'swf/';
    soundManager.flashVersion = 9;
    soundManager.useHTML5Audio = true;
    soundManager.debugMode = false;
    soundManager.flash9Options.useWaveformData = true;
    soundManager.flash9Options.useEQData = true;
    soundManager.flash9Options.usePeakData = true;
    soundManager.preferFlash = true;

This did the trick :)

0
Evhz On

If you only need the peakData information, this configuration might help you:

soundManager.flash9Options = {
  usePeakData: true,      // enable left/right channel peak (level) data
  useWaveformData: false, // enable sound spectrum (May set CPUs on fire)
  useEQData: false,       // enable sound EQ (Also CPU-intensive)      
}

then make sure the soundmanager uses flash version 9:

soundManager.setup({
  url: '/soundmanager/swf/',
  flashVersion: 9, 
  // useHighPerformance: true,     
  preferFlash: true,      
  debugMode: true,
  onready: function() {},
});

This configuration loads peakData in the sound Object