Flash Voice Advanced: Nullsound Technology-2

Source: Internet
Author: User
Tags constant continue file size key
Advanced these results are persuasive, if we make a "silent" version (all the animations remain intact, only delete all the sound) then the output file size is 655kb. If we compare the size differences of the two files, the result shows that the entire sound file using the Str00 method takes up only 59KB!!! In the traditional way, music files will occupy 595kb.

Further note: If there are 5 to 6 2, 3 seconds of sound files, which constitute 1, 2, 3 minutes or more, the volume of music files will be less than 70~80k. In contrast, if the traditional method is used, the file size will be 1MB or more.

Here's how it works:

   STR0 Technology:

First, let's choose a sound file "Nullsound" as small as possible. This small WAV file contains nothing but mute, about 0.1 seconds long. We can use any sound editing software to generate it. Then we put the file inside the timeline, then set it to the stream mode, and set the number of loops so that the sound extends to the end of the flash. We only set this Nullsound file as the stream mode, and the other sounds are organized in layers and are set to event mode. In this way, we can set the stream sound output quality low enough (ADPCM 5 khz 2 bit) while not affecting the sound quality of the entire music, because the event mode of sound can be set high some such as ADPCM one kHz 4 bit. 。

Take a look at the following legend:

Figure 1. The main timeline inside the STR0 technology

Figure 2. Nullsound sound settings in the timeline

Figure 3. Stream and event sound quality settings for export

We can fine-tune the above technology to make the file smaller, which is what we call Str00 technology:

   str00 Technology:

We set the number of loops in the previous technique to 1 times, while the others remained unchanged. Nullsound This technique is based on an interesting feature of Flash: If a sound file is set to stream in time, Flash will continue to play the sound in stream mode after playing the sound file. That is, we can use such a small nullsound sound file as a switch to make the entire player play the sound in stream mode. This stream playback mode can be turned off using the "Stop all Sound" action. With this approach, we can also switch the stream pattern flexibly in the movie or the event mode, which means that you can switch between constant frame rate and frame rate variable mode.

The following illustration describes this str00 technique

Figure 4. The Nullsound on the main timeline only loops once

Figure 5. setting of Nullsound Sound

STR00 Technology's accompanying instructions:

The only drawback of the str00 technology is that if the user uses a standalone player to play Flash, then Flash will stop all sound playback, even if you press ENTER to continue playing, and the stream's sound will not play, Because the key frame of the stream sound is at the front, the consequence is that the stream mode is turned off, that is, the constant frame rate mode is closed. To avoid this error, the solution is to place an invisible button to catch the key action:

On (Key: )
Play
End on

Figure 6. The action setting on the Stealth button

Translator Note: This syntax is FLASH4 syntax, replaced by FLASH5 version syntax as follows:

on (keyPress " ") {
Play ();
}


Similarly, pop-up menus in a standalone player should also be disabled at the beginning:

FS Command ("ShowMenu", "false")

Figure 7. Disables the pop-up menu action setting

Translator Note: This syntax is FLASH4 syntax, replaced by FLASH5 later version syntax as follows:

Fscommand ("ShowMenu", "false"); After the

has used the above settings, Flash will theoretically not stop abnormally.

Translator Summary:

This technology applies background: background sound effects need to cycle, animation and sound need to keep synchronized, high quality requirements, file size requirements as small as possible.

Tip:

When making an animation, you can set all the sounds into stream mode to adjust the animation and sound match exactly. When the correct sound animation is all matched, set all sounds to event, and then set Nullsound as stream to reduce the volume of the file.

If you have conditions, try to split the music elements, extract the merge to recycle the parts, and then use Flash as a mixer, which will effectively reduce the size of the output file.

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.