wav

Playing .mp3 files with PyAudio

喜夏-厌秋 提交于 2019-11-30 15:47:30
Can pyaudio play .mp3 files? If yes, may I ask to write an example please. If no, what is the simplest way to convert .mp3 to .wav? I have tried to use PyDub, could get my .wav file, but when I try to play it with PyAudio I get following error: File "C:\Python33\lib\wave.py", line 130, in initfp raise Error('file does not start with RIFF id') wave.Error: file does not start with RIFF id With other .wav samples (which where not converted from mp3) if works well. I am using gTTS library to convert text to speech for my application. It creates short .mp3 files which I need to play then. Right now

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

放肆的年华 提交于 2019-11-30 15:40:20
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 method public byte[] makeChimeraAll(int offset){ for(int i=offset;i<bigData.length;i++){ if(i <

compressed and uncompressed .wav files

两盒软妹~` 提交于 2019-11-30 15:23:38
What is the difference between compressed and uncompressed .wav files? 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 which is uncompressed PCM , but it can also store ADPCM , MP3 and other formats, and can be read and written

Is there any pure java way to convert .wav to .mp3?

雨燕双飞 提交于 2019-11-30 14:14:24
问题 I've struggled a lot with Java but could not combine a working example of Java .wav to .mp3 converter. This converter will be used in a Java applet so it should depend only on libraries written in pure Java with no underlying C code calls. Can anyone provide a fully working example? Thank you 回答1: Read your wave file @ http://java.sun.com/javase/technologies/desktop/media/jmf/ and encode to mp3 @ http://openinnowhere.sourceforge.net/lameonj/ As pointed out, lameonj is not a pure java solution

scipy.io.wavfile.read cannot read 24-bits .wav files

不打扰是莪最后的温柔 提交于 2019-11-30 14:03:22
问题 It seems that scipy.io.wavfile.read cannot read 24-bits .wav files. Do you have an idea on how to handle them ? 回答1: If your wav files are not compressed, you can try the readwav function here: https://gist.github.com/WarrenWeckesser/7461781 Update I converted that gist to a python package: https://pypi.python.org/pypi/wavio The source code is on github: https://github.com/WarrenWeckesser/wavio 回答2: Here is an updated version of scipy.io.wavfile that adds many things: 24 bit .wav files

How to combine a .mp4 video with a .wav audio with an offset in ffmpeg from command line?

杀马特。学长 韩版系。学妹 提交于 2019-11-30 13:41:00
I've got a TV clip in mp4 format containing audio and video, and an WAV audio_commentary track. I've been trying to combine them in ffmpeg and then play it online with a flash player (which can only take h264 format) What's the best ffmpeg command to accomplish this? My inputs are MP4 video, WAV audio, and an offset in seconds, the time the audio commentary starts relative to the start of the mp4 video. I tried ffmpeg -i input_audio.wav -i input_vid.mp4 -vcodec copy output.mp4 and ffmpeg -vcodec copy -ss offset -i input_audio.wav -i input_video.mp4 output.mp4 nether of these do what I want and

Is there any pure java way to convert .wav to .mp3?

杀马特。学长 韩版系。学妹 提交于 2019-11-30 10:04:37
I've struggled a lot with Java but could not combine a working example of Java .wav to .mp3 converter. This converter will be used in a Java applet so it should depend only on libraries written in pure Java with no underlying C code calls. Can anyone provide a fully working example? Thank you Nathan Kidd Read your wave file @ http://java.sun.com/javase/technologies/desktop/media/jmf/ and encode to mp3 @ http://openinnowhere.sourceforge.net/lameonj/ As pointed out, lameonj is not a pure java solution. For that the options don't seem so many, but see the other SO question: MP3 Encoding in Java

Normalising FFT data (FFTW)

烈酒焚心 提交于 2019-11-30 09:55:40
Using FFTW I have been computing the FFT of normalized .wav file data. I am a bit confused as to how I should normalise the FFT output, however. I have been using the method which seemed obvious to me, which is simply to divide by the highest FFT magnitude. I have seen division by 1/N and N/2 recommended, however (where I assume N = FFT size). How do these work as normalisation factors? There doesn't seem to me to be an intuitive relation between these factors and the actual data - so what am I missing? Huge thanks in advance for any help on this. Surprisingly there is no single agreed

How to stream a WAV file?

依然范特西╮ 提交于 2019-11-30 09:24:59
问题 I'm writing an app where I record audio and upload the audio file over the web. In order to speed up the upload I want to start uploading before I've finished recording. The file I'm creating is a WAV file. My plan was to use multiple data chunks. So instead of the normal encoding (RIFF, fmt , data) I’m using (RIFF, fmt , data, data, ..., data). The first issue is that the RIFF header wants the total length of the whole file, but that is of course not known when streaming the audio (I’m now

Why are an integers bytes stored backwards? Does this apply to headers only?

与世无争的帅哥 提交于 2019-11-30 08:50:53
I'm currently trying to decipher WAV files. From headers to the PCM data. I've found a PDF ( http://www.tdt.com/T2Support/technical_notes/tn0132.pdf ) detailing the anatomy of a WAV file, and I've been able to extract and make sense of the appropriate header data using Ghex2. But my questions are: Why are the integers bytes stored backwards? I.e. dec. 20 is stored as 0x14000000 instead of 0x00000014. Are the integers of the PCM data also stored backwards? FixerMark WAV files are little-endian (least significant bytes first) because the format originated for operating systems running on intel