wave

ffmpeg to convert from flac to wav

青春壹個敷衍的年華 提交于 2019-11-28 23:17:32
I need to convert a flac file to a wav file without changing sample rate and bit depth. As far as I know changing these properties may distort the audio, so how do i specify them not to be changed? Also, is there any way to prevent metadata to be written to the output file? Multimedia Mike As rogerdpack commented, the command line: ffmpeg -i inputfile.flac output.wav should do exactly what you want. Addressing your concerns about keeping the resulting audio intact, FLAC is a lossless format and decoding it to raw PCM stored in a WAV file will keep perfect fidelity. The only thing you might

Any good C/C++ DSP library? [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 17:55:56
问题 Which DSP library in C/C++ would you recommend? I will need it for real-time embedded systems. It'd be great to have sound signal processing accompany too, but not a mandatory. If you have knowledge of any DSP library, please kindly share. 回答1: We are thinking of AVR, ARM and even some middle range chips Neither are particularly designed for DSP, but if your performance requirements are modest enough that may not be a problem. What do you need the DSP to do? I suggest that you choose your

Python, How to split a .wav file into multiple .wav files

大憨熊 提交于 2019-11-28 10:05:25
I have a .wav file several minutes long that I would like to split into different 10 second .wav files. This is my python code so far: import wave import math def main(filename, time): read = wave.open(filename, 'r') #get sample rate frameRate = read.getframerate() #get number of frames numFrames = read.getnframes() #get duration duration = numFrames/frameRate #get all frames as a string of bytes frames = read.readframes(numFrames) #get 1 frame as a string of bytes oneFrame = read.readframes(1) #framerate*time == numframesneeded numFramesNeeded=frameRate*time #numFramesNeeded*oneFrame=numBytes

What is the easiest way to read wav-files using Python [summary]?

落爺英雄遲暮 提交于 2019-11-28 08:44:00
I want to use Python to access a wav-file and write its content in a form which allows me to analyze it (let's say arrays). I heard that "audiolab" is a suitable tool for that (it transforms numpy arrays into wav and vica versa). I have installed the "audiolab" but I had a problem with the version of numpy (I could not "from numpy.testing import Tester"). I had 1.1.1. version of numpy. I have installed a newer version on numpy (1.4.0). But then I got a new set of errors: Traceback (most recent call last): File "test.py", line 7, in import scikits.audiolab File "/usr/lib/python2.5/site-packages

Reading writing WAV/RIFF Tags

与世无争的帅哥 提交于 2019-11-28 05:51:41
问题 I'm writing a simple audio recording utility which I want also to be able to tag the resulting files with meta data. It's pretty easy to find libraries to tag MP3 files with ID3 tags, but I'm more interested in lossless codecs like WAV and possibly FLAC. As I understand it WAVE files are really a subset of the RIFF file type which can contain both waveform "chunks" and metadata "chunks". Can anyone point me in the direction of libraries, specifications, or sample projects that would help me

NAudio playing a sine wave for x milliseconds using C#

微笑、不失礼 提交于 2019-11-28 03:51:48
问题 I am using NAudio to play a sinewave of a given frequency as in the blog post Playback of Sine Wave in NAudio . I just want the sound to play() for x milliseconds and then stop. I tried a thread.sleep, but the sound stops straightaway. I tried a timer, but when the WaveOut is disposed there is a cross-thread exception. I tried this code, but when I call beep the program freezes. public class Beep { public Beep(int freq, int ms) { SineWaveProvider32 sineWaveProvider = new SineWaveProvider32();

Need a library that generates WAVE from Midi

人盡茶涼 提交于 2019-11-28 01:19:23
问题 I have about 80 compositions written in MIDI and I want to convert them in to WAVE using a sound library. So they can be played on all computers and sound the same. Is there a library that can automate this? Preferably in C#, but other programming languages are fine too. 回答1: This is what's called a Soft Synth, you will also need a set of instrument samples if you want them the sound the same on all machines. You may find that you will save memory if you just convert them all to wave files

Saving each WAV channel as a mono-channel WAV file using Naudio

大兔子大兔子 提交于 2019-11-28 01:07:25
问题 I'm trying to convert a WAV file(PCM,48kHz, 4-Channel, 16 bit) into mono-channel WAV files. I tried splittiing the WAV file into 4 byte-arrays like this answer and created a WaveMemoryStream like shown below but does not work. byte[] chan1ByteArray = new byte[channel1Buffer.Length]; Buffer.BlockCopy(channel1Buffer, 0, chan1ByteArray, 0, chan1ByteArray.Length); WaveMemoryStream chan1 = new WaveMemoryStream(chan1ByteArray, sampleRate, (ushort)bitsPerSample, 1); Am I missing something in

Opening a wave file in python: unknown format: 49. What's going wrong?

∥☆過路亽.° 提交于 2019-11-28 00:22:33
问题 I try to open a wave file with the wave module, but I keep getting the same error whatever I try. The line with the error is the following: wav = wave.open(f) This is the error message: Traceback (most recent call last): File "annotate.py", line 47, in <module> play(file) File "annotate.py", line 33, in play wav = wave.open(f) File "C:\Program Files (x86)\Python\lib\wave.py", line 498, in open return Wave_read(f) File "C:\Program Files (x86)\Python\lib\wave.py", line 163, in __init__ self

How to write stereo wav files in Python?

独自空忆成欢 提交于 2019-11-27 22:20:10
The following code writes a simple sine at frequency 400Hz to a mono WAV file. How should this code be changed in order to produce a stereo WAV file. The second channel should be in a different frequency. import math import wave import struct freq = 440.0 data_size = 40000 fname = "WaveTest.wav" frate = 11025.0 # framerate as a float amp = 64000.0 # multiplier for amplitude sine_list_x = [] for x in range(data_size): sine_list_x.append(math.sin(2*math.pi*freq*(x/frate))) wav_file = wave.open(fname, "w") nchannels = 1 sampwidth = 2 framerate = int(frate) nframes = data_size comptype = "NONE"