Copy link to clipboard
Copied
Hey,
We have code for an RTMP streaming audio player (which uses SoundMixer.computeSpectrum) which has been working fine for about a year now, but recently stopped working. Just looking for advice and pointers. We originally thought that this was an issue relating to Flash 16 but seems we do see this problem on Flash 15 and 14 too (slowly working my way back through the versions...)
It isn't an issue on the Flash version available for Ubuntu (Flash v11) as it works fine on our development machines (hence not noticing this issue in production)
Snippets here:
// This gets called on Event.ENTER_FRAME:
SoundMixer.computeSpectrum(wave_form_data, false, 2);
...
private function wave_data ():void { | |
var list = []; | |
for (var i:int = 0, j:int = wave_form_data.length / 4; i < j; i++) { | |
list.push(int(wave_form_data.readFloat() * 512)); | |
} | |
js_callback('wave_data', list.slice(0, 256).join(','), list.slice(256).join(',')); | |
} |
This method is called several times per second via a timer:
this.wave_timer = setInterval(wave_data, 100);
And cleared when the stream is stopped:
clearInterval(wave_timer);
But we have started to see two issues:
1) The wave_data JS callback comes through to the browser intermittently (seems a bit sporadic - occasionally we get 3 or 4 events through at once when the stream starts, or sometimes just one, or at one point I got nothing until a few seconds after stopping the stream then got 50 of them through at once.
2) the waveform data (which come from readFloat() ) is always filled with zeroes regardless of the audio playing at any given time.
As mentioned the same code works in previous versions of Flash.
Would be grateful for any advice here.
Thanks.
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now