reading wav files into array

hello all;

please help me about his subject.I want to read a wav file into a double array.No time to learn.just quick help.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Which parts of it?
You can read the file to bytes array, not to double array. You'll have to apply some kind of conversion or at least a type cast later.
Actually You can read a double, but it will be interpreted by Java the way You won't be satisfied with. For that You use DataInputStream:

DataInputStream dis = new DataInputStream(new FileInputStream("f.wav"));
double d = dis.readDouble();

I guess the class RandomAccessFile will the best fit Your needs, check it here:

Also notice that all the classes mentioned here are from package , which should be imported when used.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Mick BarryJava DeveloperCommented:
Mayank SAssociate Director - Product EngineeringCommented:
BTW, this is a duplicate of the already posted question:
dervisakyuzAuthor Commented:
this are good but i am very new about java.

this is a code in c++ what i want..but i need it in java??

any excelllent expert can do it??

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

#include "aec.h"

#define TAPS        (80*8)

typedef signed short MONO;

typedef struct {
  signed short l;
  signed short r;

float dB2q(float dB)
  /* Dezibel to Ratio */
  return powf(10.0f, dB / 20.0f);

float q2dB(float q)
  /* Ratio to Dezibel */
  return 20.0f * log10f(q);

/* Read a raw audio file (8KHz sample frequency, 16bit PCM, stereo)
 * from stdin, echo cancel it and write it to stdout
int main(int argc, char *argv[])
  STEREO inbuf[TAPS], outbuf[TAPS];

  fprintf(stderr, "usage: aec_test [ambient in dB] <in.raw >out.raw\n");

  AEC aec;

  if (argc >= 2) {

  int taps;
  while (taps = fread(inbuf, sizeof(STEREO), TAPS, stdin)) {
    int i;
    for (i = 0; i < taps; ++i) {
      int s0 = inbuf[i].l;      /* left channel microphone */
      int s1 = inbuf[i].r;      /* right channel speaker */

      /* and do NLMS */
      s0 = aec.doAEC(s0, s1);

      /* copy back */
      outbuf[i].l = 0;          /* left channel silence */
      outbuf[i].r = s0;         /* right channel echo cancelled mic */

    fwrite(outbuf, sizeof(STEREO), taps, stdout);

  float ambient = aec.getambient();
  float ambientdB = q2dB(ambient / 32767.0f);
  fprintf(stderr, "Ambient = %2.0f dB\n", ambientdB);
  return 0;
Mayank SAssociate Director - Product EngineeringCommented:
Pls don't post on this duplicate question anymore. Let's continue the discussion on the original one (the link I posted).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.