Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 515875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:40:24+00:00 2026-05-13T07:40:24+00:00

var sound:Sound = new Sound(); var req:URLRequest = new URLRequest(url); sound.load(url) I want to

  • 0
var sound:Sound = new Sound();
var req:URLRequest = new URLRequest(url);
sound.load(url)

I want to modify the sound data (an mp3) as it comes in. Specifically, the mp3 will be encrypted using a stream cipher and I want to decrypt the data as it comes in. Is this possible using some type of event?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:40:24+00:00Added an answer on May 13, 2026 at 7:40 am

    To process an existing audio stream, you have to set up an output Sound object, without loading a sound into it. Then listen on that sound object for the SampleDataEvent.SAMPLE_DATA, which is fired whenever a Sound object, for which the buffer is empty, starts playing. You will need to fill it’s buffer with stereo PCM data (pairs of floating point numbers.)

    To get those numbers, use the Sound.extract() method on your input Sound object (the one you’ve simply called sound in your code above) to read PCM data to a ByteArray. Process the data of that ByteArray however you want, and put it in the output buffer.

    var input : Sound;
    var output : Sound;
    
    // ... set up your input sound source ... //
    
    output = new Sound();
    output.addEventListener(SampleDataEvent.SAMPLE_DATA, handleSampleData);
    output.play();
    
    // The SAMPLE_DATA event is dispatched whenever the output Sound object
    // buffer is empty. Fill the buffer to keep playing sound.
    function handleSampleData(ev : SampleDataEvent) : void
    {
      var buffer : ByteArray = new ByteArray;
    
      input.extract(buffer, 2048);
    
      // PCM data from input is now in the buffer ByteArray. Filter the sound
      // data according to your requirements here.
    
      ev.data.writeBytes(buffer);
    }
    

    There’s also some sample code on the subject in the reference documentation for the extract() method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My as3 code to load external sound: var s:Sound = new Sound(); s.addEventListener(Event.COMPLETE, onSoundLoaded);
Can i create multiples functions inside for loop? var mySound1 = new buzz.sound( laser-01,
Having the following code: var loadingSoundTitle:String; var loadingSound:Sound = new Sound(); function loadFile(str:String) {
I have a code as below import flash.media.Sound; import flash.media.SoundChannel; flash.system.Security.allowDomain(*); var request:URLRequest =
i'm loading several sound files, and want to error check each load. however, instead
var snd:Sound = new Sound(); var t:Timer = new Timer(100); var sndChannel:SoundChannel; snd.addEventListener(Event.COMPLETE,onComplete); t.addEventListener(TimerEvent.TIMER,onTimer);
In JavaScript, I have code like this: var sound = new Audio(name); sound.onended =
var ref1 = new Firebase(http://gamma.firebase.com/myuser/123,456); ref1.set(123,456); var on1 = ref1.on(value, function(snapshot) { console.log(snapshot.val()); });
hi im really new to actionscript and ive have a problem with playing sound.
I'm working on a virtual piano keyboard that processes imported mp3 sound samples. I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.