Copy link to clipboard
Copied
!
Speed up the audio on this code
var musicChannel:SoundChannel;
var currentSongIndex:int;
function onPlayBtnPressed() {
currentSongIndex = 0;
playSongFromIndex(currentSongIndex);
}
function playSongFromIndex(songIndex:int) {
musicChannel = ars[songIndex].play();
musicChannel.addEventListener(Event.SOUND_COMPLETE, songFinished);
currentSongIndex++;
}
function songFinished(e:Event) {
if (currentSongIndex < ars.length) {
playSongFromIndex(currentSongIndex);
} else {
currentSongIndex=0;
}
}
You can apply this code to the top code
var sourceSnd:Sound = new sou1();
var outputSnd:Sound = new Sound();
outputSnd.addEventListener(SampleDataEvent.SAMPLE_DATA, processSound);
outputSnd.play();
function processSound(event:SampleDataEvent):void {
var bytes:ByteArray = new ByteArray();
sourceSnd.extract(bytes, 4096);
event.data.writeBytes(upOctave(bytes)); }
function upOctave(bytes:ByteArray):ByteArray {
var returnBytes:ByteArray = new ByteArray();
bytes.position = 0;
while(bytes.bytesAvailable > 0)
{
returnBytes.writeFloat(bytes.readFloat());
returnBytes.writeFloat(bytes.readFloat());
if (bytes.bytesAvailable > 0)
{
bytes.position +=8;
}
}
return returnBytes;
}
////////////
///////////
//////////
////////
////////// ! !
Copy link to clipboard
Copied
Please post the name of the program you use so a Moderator may move this message to that forum
-A program would be Audition or Premiere Pro or ???
Copy link to clipboard
Copied
The program uses the Adobe Animate CC
[Moved from the non-technical Lounge to the specific Program forum... Mod]
[Here is the list of all Adobe forums... https://forums.adobe.com/welcome]
Find more inspiration, events, and resources on the new Adobe Community
Explore Now