Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Speed ​​up the audio on this code

New Here ,
Nov 30, 2018 Nov 30, 2018

!

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;

}

////////////

///////////

//////////

////////

////////// ! !

153
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2018 Nov 30, 2018

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 ???

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 30, 2018 Nov 30, 2018
LATEST

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]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines