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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:12:22+00:00 2026-06-01T00:12:22+00:00

I am doing the following in my code: _sound = new Sound(); _sound.addEventListener( SampleDataEvent.SAMPLE_DATA,

  • 0

I am doing the following in my code:

        _sound = new Sound();
        _sound.addEventListener( SampleDataEvent.SAMPLE_DATA, handlePlaybackSampleData );
        _soundChannel = _sound.play();

Usually this should result in the Sound calling the handle… function when it wants to play so that I can insert my own generated ByteArray for the sound.
But it doesn’t even call that function and sometimes (!!!) crashes instead with an:

Error #2004: One of the parameters is invalid.

I have no idea why this is happening. In all examples it works exactly like that.
It also doesn’t make too much sense as all parameters in play() are optional anyway.

Before that happens, I am recording the microphone input to a buffer, and then want to playback what I have recorded, which is what all this is for.

Edit:
Here is the function:

    public function handlePlaybackSampleData(p_sampleEvent:SampleDataEvent) :void 
    {
        // Read data until either MAX_SAMPLES or all available samples are reached.
        var i:int = 0;
        var data :Number = 0;
        while( i < 8192 )
        {
            if( _lastRecord.bytesAvailable )
            {
                data = _lastRecord.readFloat();
                p_sampleEvent.data.writeFloat(data);
                p_sampleEvent.data.writeFloat(data);
                i++;
                continue;
            }
            else 
            {
                break;
            }
        }
    }
  • 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-01T00:12:23+00:00Added an answer on June 1, 2026 at 12:12 am

    To have this question get an “official answer”, here is what happened:

    The sample rate was a problem, as you can see in a different question. Solving that also somehow solved this problem.

    Unfortunately, I can’t really explain how. Maybe it was just a slightly f*cked up compilation and restarting everything fixed it. In any case, it is gone now.

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

Sidebar

Related Questions

The following code is suppose to be doing this : - Displaying a string
So I have the following code which is doing a setInterval until the iframe
Doing an ajax get request works as expected using the following code: $.ajax({ type:
Given the following code $c= new SoapClient('http://www.webservicex.net/CurrencyConvertor.asmx?WSDL'); $usa = USD; $eng = GBP; doing
I have the following code that's looping through files in a folder and doing
I'm doing a small app in Excel, and I have the following code when
I have the following PHP code doing a very simple select into a table.
I have the following code doing Sin/Cos function using a pre-calculated memory table. in
How would I go about doing the following in C++ (the following code is
I am doing following code to send a email on gmail with javamail. import

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.