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 4617060
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:04:17+00:00 2026-05-22T02:04:17+00:00

I wonder how can I work with mp3 that was loaded to to flash

  • 0

I wonder how can I work with mp3 that was loaded to to flash via fileReference.browse() method ?

Currently I’ve created an lash application that can load mp3 file from local hard drive to flash and provide an option to save mp3 file that was loaded back to the hard drive.
But I can’t find the way to work with mp3 that was loaded.
I’ve heard about flash based editor that will be available in Aviary.(http://aviary.com/blog/posts/aviary-acquires-digimix),
so there is a way to work with mp3 in flash, but how?

Here is my code:

import flash.net.FileReference;      
import flash.net.FileFilter;
import flash.utils.ByteArray;
import flash.display.MovieClip;
import flash.net.*;
import flash.events.*;
import flash.media.Sound;
import flash.media.SoundChannel;



var fileReference:FileReference;
var myChannel:SoundChannel;
var mySound:Sound;
var mySprite:Sprite;
var mySprite2:Sprite;

mySound=new Sound();
myChannel=new SoundChannel();


load_btn.addEventListener (MouseEvent.CLICK, onLoadClick);
unload_btn.addEventListener (MouseEvent.CLICK, onUnloadClick);

function onLoadClick ( event:MouseEvent):void

{
    fileReference=new FileReference();
    var allTypeFilter:FileFilter = new FileFilter("mp3: (*.mp3)","*.mp3");
    fileReference.browse([allTypeFilter]);
    fileReference.addEventListener(Event.SELECT, selectHandler);

}

function selectHandler(event:Event):void
        {
            fileReference.removeEventListener(Event.SELECT, selectHandler);
            fileReference.addEventListener(Event.COMPLETE, loadCompleteHandler);
            fileReference.load();
        }

function loadCompleteHandler(event:Event):void
        {
            fileReference.removeEventListener(Event.COMPLETE, loadCompleteHandler);

            var loader:Loader = new Loader();
            //loader.contentLoaderInfo.addEventListener(Event.COMPLETE, startPlay);
            loader.loadBytes(fileReference.data);
        }

function onUnloadClick (event:MouseEvent)

{
    trace(fileReference.data);
    fileReference.save(fileReference.data, "done.mp3");

}

Thanks in advance.

  • 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-22T02:04:18+00:00Added an answer on May 22, 2026 at 2:04 am

    It’s strangely complicated. For some reason, there isn’t any API to create a sound object from either a FileReference or a ByteArray, so you have to parse (not decode) the MP3 and create a SWF that can be loaded via flash.display.Loader.loadBytes.

    Check out blog post for details and a library to do this. Once you’ve loaded the Sound object, you can use the extract() method to get the PCM audio data which you can use in your editor.

    To generate an MP3 from the edited PCM, it looks like there are some Flash mp3 encoders, but I haven’t used any.

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

Sidebar

Related Questions

We have openCV code that uses IPP. We wonder if this can work on
I'm having a strange problem that I can't work out and wonder if anybody
I wonder about that can I write native SQL to add or delete operations
I wonder how can I change my code so, that the number of given
Membase seems pretty promising. Just wonder if Play! can work with Membase. Can anyone
I wonder that, Ruby programming language is ...(easy/difficult) to learn. I can develop web
I wonder if They can work perfectly together...
I wonder who of you can work on several projects the same day, dedicating
I wonder if anyone can work this HTML, CSS, Javascript puzzle out? I'm using
I wonder if anybody can explain why in the first created div the background

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.