在 Flash 中混合多种声音

发布于 2024-08-01 14:09:11 字数 101 浏览 2 评论 0原文

我在 Flash 中有几个声音对象,我想混合这些声音文件中的不同点来创建一个杰作并将其保存为 mp3。 我在网上看到了各种“混合器”应用程序,并且想知道要查看哪些区域才能自己完成此操作。

I have several sound objects in flash, I would like to mix different points in these sound files to create a single masterpiece and save it as an mp3.
I've seen various "mixer" applications online and would like to know what area(s) to look at to be able to do this myself.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浮生未歇 2024-08-08 14:09:12

要创建音乐或您想要创建的任何内容,您必须将 wav 和 mp3 文件导入到您的库中,并将它们拖到电影区域以将它们添加到您的时间线中。 使用多个图层来帮助组织它们。 要测试您的歌曲,您可以按 Enter 键从您所在的任何帧运行到结束。

不要忘记,如果您在时间轴中选择了声音,则可以应用一些效果。 此外,“属性”面板上有一个“编辑”按钮(默认位于底部),您可以使用它来将音频剪辑修剪为您需要的任何内容。

完成后,您必须将 Flash 影片发布为 swf。 然后你必须使用一个 Swf 到 Mp3 转换器,如下所示:

http://3d2f.com/programs/25-187-swf-to-mp3-converter-download.shtml

(我不保证这个软件,这只是一个例子)

如果你如果您尝试通过代码来完成所有这些工作,那么使用 ActionScript 2.0,您的前路将会很艰难。

本质上,您必须构建一个充满已加载到电影中的修剪声音字节的数组。 然后在 onEnterFrame 中,您必须在适当的时间调用它们:(

我根本没有测试此代码,这只是为了给您一个基本的想法,哈哈)

var sounds = new Array();
var s0 = new Sound(this);
s0.attachSound("someLinkedSound0");
sounds.push({sound : s0, frame : 100});
var s1 = new Sound(this);
s1.attachSound("someLinkedSound1");
sounds.push({sound : s1, frame : 200});
var s2 = new Sound(this);
s2.attachSound("someLinkedSound2");
sounds.push({sound : s2, frame : 300});
var currentSound = 0;

this.onEnterFrame = function(e) {
    if(currentSound < sounds.length && sounds[currentSound].frame == _root.currentFrame) {
        sounds[currentSound].start(0,1);
        currentSound++;
    }
    frame++;
}

我的示例使用导入到您的库中的声音和“链接”,但您可以通过 url 加载声音,只需稍加修改。

如果由于应用程序的结构未调用 onEnterFrame,您还可以使用从 setInterval 调用的方法来完成类似的操作。
我希望这有帮助。

To create the music or whatever you're trying to create, you'll have to Import your wav and mp3 files into your library and drag them onto the movie area to add them to your timeline. Use multiple layers to help organize them. To test your song out you can hit Enter to run from whatever frame your on forward to the end.

Don't forget you have a few effects you can apply if you have the sound selected in your timeline. Also, there's an "Edit" button on the Properties panel (at the bottom by default) you can use to trim your audio clips to whatever you need them to be.

Once you're done, you'll have to publish your flash movie to a swf. Then you'll have to use a Swf to Mp3 converter like this one:

http://3d2f.com/programs/25-187-swf-to-mp3-converter-download.shtml

(I'm not vouching for this software, it's just an example)

If you're trying to do all of this from code, with ActionScript 2.0, you're going to have a hard road ahead.

Essentially, you'd have to build an array full of trimmed sound bytes you've loaded into your movie. Then in an onEnterFrame you'd have to call them at the appropriate times:

(I didn't test this code at all, it's just to give you a basic idea, lol)

var sounds = new Array();
var s0 = new Sound(this);
s0.attachSound("someLinkedSound0");
sounds.push({sound : s0, frame : 100});
var s1 = new Sound(this);
s1.attachSound("someLinkedSound1");
sounds.push({sound : s1, frame : 200});
var s2 = new Sound(this);
s2.attachSound("someLinkedSound2");
sounds.push({sound : s2, frame : 300});
var currentSound = 0;

this.onEnterFrame = function(e) {
    if(currentSound < sounds.length && sounds[currentSound].frame == _root.currentFrame) {
        sounds[currentSound].start(0,1);
        currentSound++;
    }
    frame++;
}

My example uses sounds that are imported to your library and "linked" but you can load a sounds via url with a little modification.

You could also accomplish something similar with a method called from a setInterval, if due to your application's structure onEnterFrame isn't being called.
I hope that helps.

鹤舞 2024-08-08 14:09:12

要在 ActionScript 2 中混合声音,请查看 此链接。 详细解释了如何使用 AS2 实现混音。 接下来,您需要查看此链接以获取有关该主题的更多信息。

直接从 AS2 不可能将声音的混合版本保存为 MP3。 您必须求助于一些复杂的服务器端脚本,该脚本知道混合声音何时启动和停止,并利用该信息可以在服务器上生成 MP3。 很棘手,但并非不可能。

或者您可以切换到 AS3,您可以创建声音在运行时(例如,一直向下滚动)并将结果保存为字节流。

For mixing sounds in ActionScript 2 have a look at this link. It's an elaborate explanation of how to achieve sound mixing with AS2. Next you need to check out this link to get some more info on the subject.

Saving out the mixed version of your sound out as a MP3 is not going to be possible directly from AS2. You'd have to resort to some elaborate server side script that knows when the mixed sounds are started and stopped and with that info can generate an MP3 on the server. Tricky, but not impossible.

Or you could just switch to AS3 where you can create sound at runtime (scroll all the way down for an example) and save out the result as a byte stream.

楠木可依 2024-08-08 14:09:12

阅读一些有关 flash SoundChannel 的信息,声音SoundTransform 类。 您所要做的就是加载不同的声音(我链接的 Flash 文档中有有关如何执行此操作的示例),并根据您的时间线播放声音。 每个声音都可以在不同的通道上播放,这样您就可以“混合”它们。 维护一系列渠道,并在任何需要的时候用它们做任何你想做的事。

拯救它们还有更多工作要做,但并非不可能。 在这里您可以找到另一个将 mp3 保存到 swf 中的示例。 其他方法我不能说我知道,但从我所见,你可以使用 Alchemy 并编译 LAME MP3 Encoder< /a> 作为闪存库。 您还需要一些后端,因为您无法使用闪存下载文件。 您必须将它们发送到服务器,然后服务器应该初始化下载。

Read a bit about flash SoundChannel, Sound and SoundTransform class. All you have to do is load your different sounds (You have examples there on how to do that in the flash docs I've linked), and play the sounds according to your timeline. Each sound can be played on a different channel, and by this you can 'mix' them. Maintain a array of channels and do whatever you want with them at whatever time you need.

To save them is a bit more work to be done but not impossible. Here you can find another example that saves a mp3 into a swf. Other methods I can't say I know but from what i've seen, you can use Alchemy and compile LAME MP3 Encoder as a flash library. You will also need a bit of backend because you cannot download files using flash. You must send them to the server then the server should initialize the download.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文