wav

using Android's AudioTrack to combine bytes of sound samples produces noise

大憨熊 提交于 2019-12-18 17:53:04
问题 I'm building a fairly simple Android app (sdk revision 14: ICS) which allows users to pick two audio clips at a time (all are RIFF/WAV format, little-endian, signed PCM-16 bit encoding) and combine them in various ways to create new sounds. The most basic method I'm using for this combination is as follows: //...sound samples are read in to memory as raw byte arrays elsewhere //...offset is currently set to 45 so as to skip the 44 byte header of basic //RIFF/WAV files ... //Actual combination

compressed and uncompressed .wav files

让人想犯罪 __ 提交于 2019-12-18 17:08:02
问题 What is the difference between compressed and uncompressed .wav files? 回答1: The WAV format is a container format for audio files in Windows. The WAV file consists of a header and the contents. The header contains information about the size, duration, sampling frequency, resolution, and other information about the audio contained in the WAV file. Generally, after the header is the actual audio data. Since WAV is a container format, the data it contains can be stored in various formats. One of

mp3 to wav conversion in java

爷,独闯天下 提交于 2019-12-18 16:52:28
问题 My code to convert mp3 to wav is: package audio1; import java.io.File; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; public class NewClass { public static void main(String [] args){ try{ AudioFileFormat inputFileFormat = AudioSystem.getAudioFileFormat(new File("c:\\1.mp3")); AudioInputStream ais = AudioSystem.getAudioInputStream(new File("c:\\1.mp3")); AudioFormat

mp3 to wav conversion in java

半腔热情 提交于 2019-12-18 16:52:02
问题 My code to convert mp3 to wav is: package audio1; import java.io.File; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; public class NewClass { public static void main(String [] args){ try{ AudioFileFormat inputFileFormat = AudioSystem.getAudioFileFormat(new File("c:\\1.mp3")); AudioInputStream ais = AudioSystem.getAudioInputStream(new File("c:\\1.mp3")); AudioFormat

Playing multiple wav files in C#

只谈情不闲聊 提交于 2019-12-18 13:42:27
问题 I have an app that I need to play a wav file when a key or button pressed or clicked, I use the SoundPlayer class but when i try to play another wav file at the same time the one that was playing stops. Is there a way to play multiple wav files at the same time? If its one could you please give me examples or tutorial? Here's what I got so far: private void pictureBox20_Click(object sender, EventArgs e) { if (label30.Text == "Waiting 15.wav") { MessageBox.Show("No beat loaded"); return; }

Playing .wav file in java from file from computer

萝らか妹 提交于 2019-12-18 09:48:40
问题 package soundTest; import java.applet.*; import java.net.*; import javax.swing.*; import javax.sound.sampled.*; import java.io.*; import java.util.*; public class SoundTest { public static void main(String[] args) throws Exception { try { AudioClip clip1 = Applet.newAudioClip(new URL(new File("E0.wav").getAbsolutePath())); clip1.play(); } catch (MalformedURLException murle) { System.out.println(murle); } URL url = new URL( "http://www.mediafire.com/listen/tok9j9s1hnogj1y/downloads/E0.wav");

java pcm to wav

眉间皱痕 提交于 2019-12-18 05:12:39
问题 I have a pcm file, and I want to convert it to a wav file. Is there any suitable api or code for this? 回答1: it's My Code /** * Write PCM data as WAV file * @param os Stream to save file to * @param pcmdata 8 bit PCMData * @param srate Sample rate - 8000, 16000, etc. * @param channel Number of channels - Mono = 1, Stereo = 2, etc.. * @param format Number of bits per sample (16 here) * @throws IOException */ public void PCMtoFile(OutputStream os, short[] pcmdata, int srate, int channel, int

Playing a sound from a wave form stored in an array

依然范特西╮ 提交于 2019-12-18 04:51:06
问题 I'm currently experimenting with generating sounds in Python, and I'm curious how I can take a n array representing a waveform (with a sample rate of 44100 hz), and play it. I'm looking for pure Python here, rather than relying on a library that supports more than just .wav format. 回答1: You should use a library. Writing it all in pure python could be many thousands of lines of code, to interface with the audio hardware! With a library, e.g. audiere, it will be as simple as this: import

How to manipulate wav file data in Python?

爱⌒轻易说出口 提交于 2019-12-18 04:49:06
问题 I'm trying to read a wav file, then manipulate its contents, sample by sample Here's what I have so far: import scipy.io.wavfile import math rate, data = scipy.io.wavfile.read('xenencounter_23.wav') for i in range(len(data)): data[i][0] = math.sin(data[i][0]) print data[i][0] The result I get is: 0 0 0 0 0 0 etc It is reading properly, because if I write print data[i] instead I get usually non-zero arrays of size 2. 回答1: The array data returned by wavfile.read is a numpy array with an integer

wav-to-midi conversion

血红的双手。 提交于 2019-12-17 22:53:44
问题 I'm new to this field - but I need to perform a WAV-to-MIDI conversion in java. Is there a way to know what exactly are the steps involved in WAV-to-MIDI conversion? I have a very rough idea as in you need to; sample the wav file, filter it, use FFT for spectral analysis, feature extraction and then write the extracted features on to MIDI. But I cannot find solid sources or papers as in how to do all that? Can some one give me clues as in how and where to start? Are there any Open Source APIs