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

  • Home
  • SEARCH
  • 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 8284279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:02:54+00:00 2026-06-08T11:02:54+00:00

Using the sound object .extract() method, it’s possible to retrieve the uncompressed sound data

  • 0

Using the sound object .extract() method, it’s possible to retrieve the uncompressed sound data as a ByteArray. What is the format of the extracted sound data? Custom internal format, or established format? Endian type?

I would like to be able to load sounddata directly into a byteArray and feed sound playback from this data (bypassing step 1 below).

Here are my experiments so far:

Step 1. Here I load a sound, extract the data content and save it to disc:

private var sound:Sound;
private var byteArray:ByteArray;

// loading a sound...
private function init():void {
    sound = new Sound();            
    sound.addEventListener(Event.COMPLETE, onComplete);
    sound.load(new URLRequest('short.mp3'));
}

// saving it to disc...
private function onComplete(e:Event):void {
    byteArray = new ByteArray();
    sound.extract(byteArray, 100000000);            
    byteArray.position = 0;
    var file:FileReference = new FileReference();
    file.save(byteArray, 'short.data');             
}

Step 2. Here I load the data from disc and feed the playback of a new sound object with this data:

private var sound:Sound;
private var byteArray:ByteArray;

// loading a sound...
private function init():void {

    file = new FileReference();
    file.addEventListener(Event.COMPLETE, onLoaded);
    file.addEventListener(Event.SELECT, onSelected);
    file.browse();

}

private function onSelected(e:Event):void {
    file.load();
}

private function onLoaded(e:Event):void {
    trace('loaded');
    trace(file.data.length);
    byteArray = file.data;

    sound2 = new Sound();
    sound2.addEventListener(SampleDataEvent.SAMPLE_DATA, onSampleData);     
    sound2.play();      
}   

private function onSampleData(e:SampleDataEvent):void {
    trace(e.position);
    for (var i:int = 0; i < 2048; i++) {
        var left:Number = byteArray.readFloat();
        var right:Number = byteArray.readFloat();               
        e.data.writeFloat(left * 0.2);
        e.data.writeFloat(right * 0.2);
    }
}

I would like to be able of accomplishing this second step (loading data from disc and feeding a sound object playback) by using an external converter utility (sox or something).

/ Jonas

  • 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-06-08T11:02:57+00:00Added an answer on June 8, 2026 at 11:02 am

    It should be standard 32bit floats, one per channel per sample. So I would try -e floating-point for sox, I haven’t tried though but I would do it with a certain level of confidence… 🙂 Floats are endian-independent, I believe…

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

Sidebar

Related Questions

Is it possible to play multiple sound files using a single sound object? (I've
I am attempting to play a sound using a MediaPlayer object, but I cannot
Using ONE Sound() object in Actionscript3, how can I play a one MP3 and
I'm using the following method to dispatch a sound in X times/minute (X is
I'm playing a prerecorded sound using a technique from an apple sample: // Set
I'm trying to play only part of a sound using FMOD, say frames 50000-100000
Currently the way /usr/sbin/alsa in Debian knows the processes using the sound card looks
I am trying to play audio buffered sound (.wav) using AudioTrack. Please see the
I'm using AVAudioPlayer to play sound effects in an iPhone game. This is part
I am using multiple instances of AVAudioPlayer to play multiple sound files in a

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.