Process audio stream files

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.