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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:59:07+00:00 2026-06-05T23:59:07+00:00

I create an audio buffer and want to edit this before I play this

  • 0

I create an audio buffer and want to edit this before I play this sound.
My problem is that i get an big noise when number is more than 1. It means I can only
play the buffer without noise when I dont edit the buffer (data).
Background informations:
data is an audiorecord buffer with following informations:

private static final String TAG = "Aufnahme";
private AudioRecord recorder = null;
private boolean isRecording = false;
private int SAMPLERATE = 44100;
private int CHANNELS = AudioFormat.CHANNEL_CONFIGURATION_MONO;
private int AUDIO_FORMAT = AudioFormat.ENCODING_PCM_16BIT;
private int bufferSize = AudioRecord.getMinBufferSize(SAMPLERATE, CHANNELS,
        AUDIO_FORMAT);
private Thread recordingThread = null;

And my effect class :

public class verzerrer {    
    public void distortion(short[] data) {      
        output out = new output();
        long[] y = new long[data.length];
        int number =1000;

        for(int i=1;i<data.length;i++){
            y[i]=(data[i]/number)*number;       
        }   

        for(int i=0;i<data.length;i++){
            data[i]=(short) y[i];
        }
        out.send(data);
    }   
}
  • 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-05T23:59:08+00:00Added an answer on June 5, 2026 at 11:59 pm

    You say “My problem is that i get an big noise when number is more than 1.” But it looks to me like a “big noise” is exactly what you are trying to create: your effect is called “distortion” and you are performing integer division when number > 1, which will create a very large amount IM distortion.

    The effect you’ve created looks to me to be analogous to a “bit crush” effect: throwing away the least significant data. If you are looking to create a more traditional distortion (like a guitar amp distortion), you’ll need to perform “clipping”, not “bit crushing”. Like this:

    for(int i=1;i<data.length;i++){
        if( data[i] > number )
            y[i]=number;
        else if( data[i] < - number )
            y[i]=-number;       
    }
    

    This will create harmonic distortion. The lower number is, the more distortion you will get. Here, “number” is called “threshold”. you may want to use something like

    number=(Short) ( Short.MAX_VALUE * ( 1-t ) ) ;
    

    to define it. Here, t is a float value. If t is closer to 1, you get more distortion, and closer to 0 you get less.

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

Sidebar

Related Questions

I want to create a script in javascript/jquery that play's/speaks the letters of a
I want create a html5 audio in dynamic and play it,here is the code:
I need to create a class to handle audio AudioTrack. In this class must
I am currently trying to create an Android application that loops Audio from the
If the device has a microphone, I would create audio device as play and
I'm looking for an API that would allow me to create an audio CD
I'm trying to play an audio in background from a WebView. This audio is
I want to cut some pieces of an audio to create a new audio
I want to create a simple audio player for Windows Phone 7. How can
I'm working at the audio buffer level, mixing audio signals created by a colleciton

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.