If you play back the file while loading the audio file or video file data, it is considered as stream transmission. Normally
Stream Transmission of external sound files loaded from the remote server, so that users do not have to wait until all sound data is loaded.
Listen to the voice.
The soundmixer. buffertime attribute indicates how long the Flash Player should collect before it allows playing the sound.
Audio Data (in milliseconds ). That is to say, if the buffertime attribute is set to 5000, the playing starts.
Before the sound, Flash Player loads at least 5000 milliseconds of data from the sound file.
The default value of soundmixer. buffertime is 1000.
By explicitly specifying a new buffertime value when loading a sound, the application can overwrite the global
Soundmixer. buffertime value. To overwrite the default buffer time, create a new
Soundloadercontext class instance, set its buffertime attribute, and pass it as a parameter
The sound. Load () method is as follows:
Import flash. Media. sound;
Import flash. Media. soundloadercontext;
Import flash.net. URLRequest;
VaR S: Sound = new sound ();
VaR Req: URLRequest = new URLRequest ("bigsound.mp3 ");
VaR context: soundloadercontext = new soundloadercontext (8000, true );
S. Load (req, context );
S. Play ();
When playback continues, flash player tries to keep the sound buffer in the same size or larger size. If the voice data
Loading speed is faster than playback speed, and playback continues without interruption. However, if the data loading rate is due to network restrictions
The playback header may reach the end of the sound buffer. In this case, the playback will be paused, but
After more audio data is added, playback is automatically resumed.
To check whether playback is paused because Flash Player is waiting to load data, use sound. isbuffering.
Attribute.