2 Replies Latest reply on Oct 16, 2009 2:19 PM by rootsical

    Sound stream problem?


      I don't know if this is an issue with Flex, or how I've set my webserver up but basically I've made an MP3 player component in flex based on the Sound class.  It works fine apart from the position slider I have made for the player (using the HSlider class in Flex 4) cannot navigate towards the end portion of the track -  the audio freezes up and the player stops playing.


      I have made sure that the position slider is only activated when the bytes loaded is equal to the total bytes, so that shouldn't be the problem - it is all buffered before I try to navigate to towards the end of the track.


      So why does it freeze up when I set the position slider towards the end of the track?


      Only thing I can think is that you have to call the stop() function to stop the Sound playing and then seek the new position.  Does stopping the sound, remove the data that you have buffered?  Is this a caching problem with webservers that I am not understanding, or can I code something in actionscript to overcome it?


      Any thoughts would be much appreciated...


      Another thought I had is whether my maths in providing  the new sound position to play from is trying to seek a position which is too precise, ie too many decimal places and that may confuse the play function so that it doesn't bother... By the way, I am having to set a new property called snap interval on the flex 4 slider for it to navigate to all values, not just 0 and 1.  Could this also be part of the problem - why does it not, by default, glide through all values from 0 to 1 like it used to?


      Thanks for any help anyone can provide...