gpt4 book ai didi

actionscript-3 - 交叉声音为 3.0

转载 作者:行者123 更新时间:2023-12-03 02:15:07 25 4
gpt4 key购买 nike

我是一个 AS 3.0 项目,我正在进入一个数组声音以组成一组特定的短语。问题是它听起来太震撼了,想制作一个交叉淡入淡出的效果来更好地把一个词附加到对方身上。
我的问题是我不能加入他们,因为每个声音一个接一个地播放,有没有办法将一个声音的结尾与下一个声音的开头合并?

非常感谢你。

我正在使用的代码是这样的:

for (iii = 0; iii < numpalabras; iii ++)
{
if (abuscar2 = abuscarArray[iii])
{
vocaliza(abuscar2, iii);
}
}

iii = 0;
localSound = lossonidosArray[iii];
var soundTrans:SoundTransform = new SoundTransform;
soundTrans=SoundMixer.soundTransform;
soundTrans.volume=1;
soundTrans.pan=0;
elcanal.soundTransform = soundTrans;
elcanal = localSound.play(85, 0, soundTrans);
elcanal.addEventListener(Event.SOUND_COMPLETE, locutapalabra);
}

function locutapalabra(event:Event)
{
if (iii < (ii))
{
iii=iii+1;
localSound = lossonidosArray[iii];
var soundTrans:SoundTransform = new SoundTransform;
soundTrans=SoundMixer.soundTransform;
soundTrans.volume=1;
soundTrans.pan=0;
elcanal.soundTransform = soundTrans;
elcanal = localSound.play(85, 0, soundTrans);
elcanal.addEventListener(Event.SOUND_COMPLETE, locutapalabra);
}

function vocaliza(abuscar2, iii)
{
if (datosXML.palabras.(palabra == abuscar2).palabra == abuscar2)
{
ii++;
elfic = "mp3/" + datosXML.palabras.(palabra == abuscar2).fichero;
var elsonido :Sound = new Sound();
elsonido.addEventListener(IOErrorEvent.IO_ERROR, errorprogreso);
var laurl:URLRequest = new URLRequest(elfic);
elsonido.load(laurl);
lossonidosArray[ii] = elsonido;
}
}

我是 AS 3.0 编程的新手,我不清楚我的代码可以使单词彼此组合在一起,因为我可以构建这样的几个单词的短语。

非常感谢你。

最佳答案

对于交叉淡入淡出,您可以使用补间库(如 greensock )来补间声道的音量:

var sound:Sound = new Sound(...);

// start volume at 0
var soundChannel = sound.play(0, 0, new SoundTransform(0));

// tween volume to 1
TweenMax.to(soundChannel, 1, { volume: 1 } );

// half a second before the sound is complete, tween volume to 0
TweenMax.to(soundChannel, .5, {volume: 0, delay:(sound.length/1000)-.5});

关于actionscript-3 - 交叉声音为 3.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20654370/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com