How to join 2 or more .WAV files together programmatically?

Here’s a basic WAV concatenation function built using NAudio. This will ensure that only the data chunks are concatenated (unlike the code example in this CodeProject article linked in another answer). It will also protect you against concatenating WAV files that do not share the same format. public static void Concatenate(string outputFile, IEnumerable<string> sourceFiles) { … Read more

Java Program to create a PNG waveform for an audio file

Below is a java class that will do this very thing. There are certain parameters that I’m hard coding here like width of image, height of image, background color of image, and some more stuff. If you want to pull those out, you could. import java.awt.BasicStroke; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.font.FontRenderContext; import … Read more

Trouble playing wav in Java

I’m not sure why the second approach you linked to starts another thread; I believe the audio will be played in its own thread anyway. Is the problem that your application finishes before the clip has finished playing? import javax.sound.sampled.*; import java.io.File; import java.io.IOException; import javax.sound.sampled.LineEvent.Type; private static void playClip(File clipFile) throws IOException, UnsupportedAudioFileException, LineUnavailableException, … Read more

What do the bytes in a .wav file represent?

You will have heard, that audio signals are represented by some kind of wave. If you have ever seen this wave diagrams with a line going up and down — that’s basically what’s inside those files. Take a look at this file picture from http://en.wikipedia.org/wiki/Sampling_rate You see your audio wave (the gray line). The current … Read more

C++ Reading the Data part of a WAV file

This image is taken from a Stanford course So you can see that the audio data occurs immediately after the headers you already read and there will be Subchunk2Size bytes of audio data. The pseudocode for this would be ReadRIFF(); ReadFMT(); int32 chunk2Id = Read32(BigEndian); int32 chunk2Size = Read32(LittleEndian); for (int i = 0; i … Read more