wav

Java AudioSystem: Reading 32 Bit Wav Files

自闭症网瘾萝莉.ら 提交于 2019-12-08 01:24:32
问题 I'm reading in audio files in 16 and 24 bit sampling bit depths and parsing them to determine their lengths without difficulty. However when reading a 32 bit file, I get javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1170) ... The 32 bit test file is manually encoded in the same manner as the others (linear PCM). I'm wondering if AudioSystem doesn't support 32 bit Wavs,

Flash swf to play PCM WAV files?

吃可爱长大的小学妹 提交于 2019-12-07 23:23:59
问题 I am in need of a Flash swf that is capable of loading PCM WAV files via a url passed to it. An example of the file can be found here: http://msdn.microsoft.com/en-us/library/ff512405.aspx The swf does not need a visible interface, as it is meant for audio playing only and not user interaction. The swf should have a simple javascript interface for page-level interactions. These include: load(url): loads a PCM WAV file over the internet using the url that is passed through it. play(): Should

Reading and writing binary files in C++

感情迁移 提交于 2019-12-07 20:40:41
问题 I am entirely new to C++ with just a couple of hours self-teaching, that started yesterday. SO: I have a uncompressed simple beep.wav file, just about 3 seconds long with a single beeping sound in it. What I am ultimately trying to achieve is, just to read the file, and at the same time write the binary data, all including: the header , ftm and data or all that is hex readable data and dump it into a simple beep.txt file. is this possible, in C++? If so, how should I begin reading and dumping

Change huge amount of data from NIST to RIFF wav file

♀尐吖头ヾ 提交于 2019-12-07 17:38:43
问题 So, I am writing a speech recognition program. To do that I downloaded 400MB of data from TIMIT. When I inteded to read the wav files (I tried two libraries) as follow: import scipy.io.wavfile as wavfile import wave (fs, x) = wavfile.read('../data/TIMIT/TRAIN/DR1/FCJF0/SA1.WAV') w = wave.open('../data/TIMIT/TRAIN/DR1/FCJF0/SA1.WAV') In both cases they have the problem that the wav file format says 'NIST' and it must be in 'RIFF' format. (Something about sph also I readed but the nist file I

Batch measurements of .wav files with sox stats

六眼飞鱼酱① 提交于 2019-12-07 12:31:58
问题 My question is similar to a previous question about "get-mean-amplitude-of-wav-from-sox": Get Mean amplitude(only) of .wav from sox I would like to be able to use the stats sox to do batch measurements of 1,000's of .wav files in a directory, and store the results in a data frame or some similar structure I can save as a csv text file. For one sound file, the code would be: ./sox SampleSound.wav -n stat Resulting in the following output: Samples read: 72000000 Length (seconds): 3600.000000

How to remove header of a wavfile in Matlab

时间秒杀一切 提交于 2019-12-07 11:05:31
问题 I need to remove first 1024 bytes of a wave file. I tried to do but I got corrupted/distorted wavfile: wavFile = fopen(fullFileName, 'r'); % Open file for reading fseek (wavFile, 1024, -1);% Skip past header, which is 1024 bytes long. wF = fread (wavFile, inf, 'int16');% 16-bit signed integers wF = wF(:)'; newWavFile = fopen(strcat('new_',fileNames(fileNo).name), 'w+');% Open file for reading fwrite(newWavFile,wF); fclose(wavFile); What can be the problem? 回答1: I could manage to remove header

Remove the headers from several WAV files, and then concatenate the remaining data into one RAW file

随声附和 提交于 2019-12-07 10:49:23
问题 I have a RAW audio file which is made up of several concatenated, smaller WAV files. I can open and play this file as 48,000, 8 bit PCM, signed, mono, in Sound Forge. What I would like to do, in C#, is programmatically overwrite each individual WAV within the file with new data of equal or smaller length, which I think I'm fairly close to being able to do. I can do a File.ReadAllBytes on the RAW file, loop through the byte array, and determine the start and end location of each WAV. I then

How to learn .wav duration in Java media frame work?

可紊 提交于 2019-12-07 10:03:12
问题 I am tyring to merge an .mov file with a .wav file using java media framework, thus I need to know their duration. How can I do this? Any ideas would be appreciated.. 回答1: you can learn the duration of sound files using this way(that is VitalyVal's second way): import java.net.URL; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.DataLine; public class

How to convert a spectrogram to 3d plot. Python

最后都变了- 提交于 2019-12-07 06:36:43
问题 I am trying to achieve waterfall graph of wav file. In my attempts I noticed that this is basically a spectogram in 3d (or as close to what I need). I am trying to do this in Python with numpy and matplotlib. My main problem is I don't know how to change the plot of specgram from matplotlib into a 3d plot. Sample of my "code": sample ,data = wavfile.read('file.wav') F = Figure() a = F.add_subplot(111,projection='3d') Spec, t, freq, im = a.specgram(data,Fs=2) I've got this far and have no clue

rfft or irfft increasing wav file volume in python

笑着哭i 提交于 2019-12-06 19:56:27
I have just started writing a program to manipulate some audio in python. Before I write any filtering functions, I wanted to do a test to compare the input signal to the output signal after having the input signal go through an rfft and irfft. For some reason the output file has an incredible amount of gain in it (50db!) compared to the input file, and I can't figure out why this is happening. Here is the code: from scipy.io.wavfile import read, write from scipy.fftpack import rfft, irfft import numpy as np rate, input = read('5and10ksm.wav') transformed = rfft(input) output = irfft