wav

Python: Frequency Analysis of Sound Files

烂漫一生 提交于 2019-12-03 04:38:40
问题 I am generating some sound files that play tones at various frequencies with a certain number of harmonics. Ultimately, these sounds will be played on a device with a small speaker. I have the frequency response curve of the speaker and want to do the following in Python: Plot the frequency spectrum of sound file. I need a take the FFT of the file and plot it with gnuplot Apply a nonlinear transfer function based on the frequency response curve in the data sheet. Plot the result after the

Play a wav file with Haskell

别说谁变了你拦得住时间么 提交于 2019-12-03 04:35:40
Is there a simple, direct way to play a WAV file from Haskell using some library and possibly such that I play many sounds at once? I'm aware of OpenAL but I'm not writing some advanced audio synthesis program, I just want to play some sounds for a little play thing. Ideally the API might be something like: readWavFile :: FilePath -> IO Wave playWave :: Wave -> IO () playWaveNonBlocking :: Wave -> IO () I'm this close to merely launching mplayer or something. Or trying to cat the wav directly to /dev/snd/ or somesuch. This is how to play multiple sounds on multiple channels at once with SDL. I

Voice Recording/Saving in Delphi

不羁岁月 提交于 2019-12-03 04:01:55
Is there a component or code that allows the following: Record a spoken word (or words) and save it/them to a file that can be played back. The file must be able to be played back on XP, Vista and Windows 7. The file can be either stand alone or saved to a datasource. [Using Delphi 7 for creating apps on XP and using Absolute Database.] The functions in MMSystem.pas let you do this using Windows API. You can either use high-level functions such as the MCI functions and PlaySound , or low-level functions such as waveInOpen , waveInPrepareHeader , waveInProc etc. If you want high control, you

getting error while converting wav to amr using ffmpeg

老子叫甜甜 提交于 2019-12-03 03:18:22
I am using ffmpeg to convert amr to wav and wav to amr.Its successfully converting amr to wav but not viceversa. As ffmpeg is supporting amr encoder decoder, its giving error. ffmpeg -i testwav.wav audio.amr Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height You can try setting the sample rate and bit rate. Amr supports only 8000Hz sample rate and 4.75k, 5.15k, 5.9k, 6.7k, 7.4k, 7.95k, 10.2k or 12.2k bit rates: ffmpeg -i testwav.wav -ar 8000 -ab 12.2k audio.amr 来源: https://stackoverflow.com/questions/2559746/getting-error

How do I use afconvert to convert all the files in a directory from wav to caf?

冷暖自知 提交于 2019-12-03 02:52:18
问题 I have a directory with about 50 wav files that I need to convert to caf, because AudioServicesCreateSystemSoundID() returns an error for some of them (but not all). Here's an example of the command I've used successfully for a single file: afconvert -f caff -d LEI16@44100 -c 1 whistle.wav whistle.caf How do I do this quickly - not one-by-one for each file? 回答1: On Windows, use the %~ni syntax. for %i in (*.wav) do afconvert -f caff -d LEI16@44100 -c 1 %i %~ni.caf 回答2: Similar approach for

What does a audio frame contain?

百般思念 提交于 2019-12-03 02:48:33
问题 Im doing some research on how to compare sound files(wave). Basically i want to compare stored soundfiles (wav) with sound from a microphone. So in the end i would like to pre-store some voice commands of my own and then when Im running my app I would like to compare the pre-stored files with input from the microphone. My thought was to put in some margin when comparing because saying something two times in a row in the exatly same way would be difficult I guess. So after some googling i see

Creating a .wav File in C#

穿精又带淫゛_ 提交于 2019-12-03 02:09:51
As an excuse to learn C#, I have been trying to code a simple project: creating audio files. To start, I want to make sure that I can write files that meet the WAVE format. I have researched the format online (for example, here ), but whenever I try to play back a file, it won't open correctly. Here is my code. Is something missing or incorrect? uint numsamples = 44100; ushort numchannels = 1; ushort samplelength = 1; // in bytes uint samplerate = 22050; FileStream f = new FileStream("a.wav", FileMode.Create); BinaryWriter wr = new BinaryWriter(f); wr.Write("RIFF"); wr.Write(36 + numsamples *

Get length of .wav from sox output

别来无恙 提交于 2019-12-03 01:01:22
I need to get the length of a .wav file. Using: sox output.wav -n stat Gives: Samples read: 449718 Length (seconds): 28.107375 Scaled by: 2147483647.0 Maximum amplitude: 0.999969 Minimum amplitude: -0.999969 Midline amplitude: 0.000000 Mean norm: 0.145530 Mean amplitude: 0.000291 RMS amplitude: 0.249847 Maximum delta: 1.316925 Minimum delta: 0.000000 Mean delta: 0.033336 RMS delta: 0.064767 Rough frequency: 660 Volume adjustment: 1.000 How do I use grep or some other method to only output the value of the length in the second column, i.e. 28.107375? Thanks phihag The stat effect sends its

Convert audio file to a byte array in matlab

爷,独闯天下 提交于 2019-12-03 00:51:50
问题 I want to convert an audio file (.wav/.mp3) to a byte array like in C#. Here's my code, string imageName = Guid.NewGuid().ToString() + ".mp3"; byte[] file = System.Convert.FromBase64String(Filep); File.WriteAllBytes(Server.MapPath("FILE/" + imageName), file); return imageName; 回答1: If you want to read the raw audio data, use audioread. You call it like so: [y,Fs] = audioread(filename); filename would be the file name of your file (.mp3/.wav) and what is returned is a matrix of values stored

Analyzing wav and drawing a graph

半腔热情 提交于 2019-12-02 22:39:19
I'm trying to print out an wave from a wav file, but I'm kinda lost on how the length I should take for an sample. this is what I would love to archieve (without the colors): so for reading in my data I use the following code: // first we need to read our wav file, so we can get our info: byte[] wav = File.ReadAllBytes(filename); // then we are going to get our file's info info.NumChannnels = wav[22]; info.SampleRate = bytesToInt(wav[24], wav[25]); // nr of samples is the length - the 44 bytes that where needed for the offset int samples = (wav.Length - 44) / 2; // if there are 2 channels, we