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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:28:00+00:00 2026-05-10T14:28:00+00:00

I’m looking into writing a audio syntesizer in Java, and was wondering if anybody

  • 0

I’m looking into writing a audio syntesizer in Java, and was wondering if anybody has any advice or good resources for writing such a program. I’m looking for info on generating raw sound waves, how to output them into a usable form (playing over speakers), as well as general theory on the topic. Thanks guys.

  • 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. 2026-05-10T14:28:01+00:00Added an answer on May 10, 2026 at 2:28 pm
    1. This problem is basically about mapping functions to arrays of numbers. A language that supports first-class functions would come in really handy here.

    2. Check out http://www.harmony-central.com/Computer/Programming and http://www.developer.com/java/other/article.php/3071021 for some Java-related info.

    3. If you don’t know the basic concepts of encoding sound data, then read http://en.wikipedia.org/wiki/Sampling_rate

    4. The canonical WAVE format is very simple, see http://www.lightlink.com/tjweber/StripWav/Canon.html. A header (first 44 bytes) + the wave-data. You don’t need any library to implement that.

    In C/C++, the corresponding data structure would look something like this:

    typedef struct _WAVstruct {     char headertag[4];     unsigned int remnantlength;     char fileid[4];      char fmtchunktag[4];     unsigned int fmtlength;     unsigned short fmttag;     unsigned short channels;     unsigned int samplerate;     unsigned int bypse;     unsigned short ba;     unsigned short bipsa;      char datatag[4];     unsigned int datalength;      void* data; //<--- that's where the raw sound-data goes }* WAVstruct; 

    I’m not sure about Java. I guess you’ll have to substitute ‘struct’ with ‘class’ and ‘void* data’ with ‘char[] data’ or ‘short[] data’ or ‘int[] data’, corresponding to the number of bits per sample, as defined in the field bipsa.

    To fill it with data, you would use something like that in C/C++:

    int data2WAVstruct(unsigned short channels, unsigned short bipsa, unsigned int samplerate, unsigned int datalength, void* data, WAVstruct result) {     result->headertag[0] = 'R';     result->headertag[1] = 'I';     result->headertag[2] = 'F';     result->headertag[3] = 'F';     result->remnantlength = 44 + datalength - 8;     result->fileid[0] = 'W';     result->fileid[1] = 'A';     result->fileid[2] = 'V';     result->fileid[3] = 'E';      result->fmtchunktag[0] = 'f';     result->fmtchunktag[1] = 'm';      result->fmtchunktag[2] = 't';     result->fmtchunktag[3] = ' ';     result->fmtlength = 0x00000010;     result->fmttag = 1;     result->channels = channels;     result->samplerate = samplerate;     result->bipsa = bipsa;     result->ba = channels*bipsa / 8;     result->bypse = samplerate*result->ba;      result->datatag[0] = 'd';     result->datatag[1] = 'a';     result->datatag[2] = 't';     result->datatag[3] = 'a';     result->datalength = datalength;      result->data = data; // <--- that's were the data comes in      return 0; // an error code, not implemented, yet ...; in Java: return result } 

    Again, I’m not sure about Java but the conversion should be straightforward if you convert the void-pointer to an array corresponding to the bitrate.

    Then simply write the entire structure to a file to get a playable wave file.

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

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
i want to parse a xhtml file and display in UITableView. what is the

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.