Lace
Reaction score
0

Profile posts Postings Media Albums About

  • Now, at this point, I said to myself:

    I said:
    Hey there, myself, I was just thinking, isn't it interesting how Java allows me to get in the middle of the audio playing process, by reading the audio data from the file into a byte array (in this case, abData) and then output the data to a SourceDataLine?
    wav:
    qTlT6.png



    midi:
    QDDmC.png
    For your comparative/informative pleasure, here is the code required to play wavs and midis (gotta img them, cuz no code tags in vm).
    Thankfully, it was also chalked full of comments, so I was able to correct his/her shoddy programming without too much difficulty.
    After Googling how one might go about the daunting task of playing a wav file in Java, I found myself with some code written by some random douchebag on the interbuttz, which was chalked full of errors and poor formatting.
    My search was quite fruitful in the area of MIDI files, but the classes and methods associated with sampled sound (i.e. pretty much everything except MIDI, and even MIDI to some extent) were highly confusing, complicated, and counterintuitive. I then resorted to my next line of defense: the almighty Google!
    Alright, so my thrilling story began a number of years ago approximately equal to the golden ratio, when I became very disappointed at the lack of audio in the Java games I was making. I proceeded to browse the Java API documentation in search of a remedy to this lack of audio.
    All right I'll let you pick the topic of the postathon from the following 3 options:

    1) Gameplay details of a game I plan to make called "A Game That Doesn't Suck".
    2) My attempts at audio synthesis in Java.
    3) Moar moozic thrrry.
    Uh oh. Your convo with Nox is now only 3 pages short of equaling your convo with me. I sense a postathon in the not-too-distant future :momo:.
    The tragic thing was I halfways expected something like this to happen because I remembered you had problems with my script editor but I just went ahead anyway

    so it's pretty much all my fault
  • Loading…
  • Loading…
  • Loading…
  • Loading…
Top