wav

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

[亡魂溺海] 提交于 2020-01-19 07:58:27
问题 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

Is the endianness of format params guaranteed in RIFF WAV files?

一曲冷凌霜 提交于 2020-01-19 05:26:07
问题 Is the endianness of format params guaranteed in RIFF WAV files? I have heard conflicting answers to this including references to a RIFX file format. 回答1: Yes. If the file starts with RIFF, then it's little endian. If it starts with FFIR or RIFX, then it's probably not. Generally, supporting the WAV format means supporting RIFF files, although adding RIFX support should not prove difficult. The AES31 specification for BWF (Broadcast Wave Format) references this specification for RIFF: http:/

how to do framing for a given wave file in java

百般思念 提交于 2020-01-17 06:16:12
问题 i want to split my audio file(.wav format) in frames of 32 milliseconds each sampling frequn-16khz,number of channels-1(mono),pcm signal, sample size=93638. I am using the following code for reading my wave file which give an array which is stored in data2 array.Can some one tell me how to proceed from this -: import java.io.ByteArrayOutputStream; import java.io.File; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled

Creating a stereo sin WAV using C

左心房为你撑大大i 提交于 2020-01-16 03:29:16
问题 I am trying to create a stereo sine WAV in C, with the possibility to have a different (and possibly blank) left and right channels. A tone is generated for each channel with this function: int16_t * create_tone(float frequency, float amplitude, float duration) I then open a FILE* and call create_wav . Here are the two structures I'm using to create the WAV: struct wav_h { char ChunkID[4]; int32_t ChunkSize; char Format[4]; char Subchunk1ID[4]; int32_t Subchunk1Size; int16_t AudioFormat;

QDataStream uses sometimes 32 bit and sometimes 40 bit floats

前提是你 提交于 2020-01-15 11:13:09
问题 I am writing an application that is supposed to write an array of floats to a WAVE file. I am using a QDataStream for this, but this results in a very improbable output that I can't explain. It seems like the QDataStream sometimes chooses 32 bit floats and sometimes 40 bit floats. This messes up the entire output file, since it has to obey a strict format. My code roughly looks like this: float* array; unsigned int nSamples; void saveWAV(const QString& fileName) const { QFile outFile(fileName

How to play extracted wave file byte array in C#?

纵然是瞬间 提交于 2020-01-14 18:55:45
问题 At the moment i have managed to separate the left and right channel of a WAVE file and have included the header in a byte[] array. My next step is to be about to play both channels. How can this be done? Here is a code snippet: byte[] song_left = new byte[fa.Length]; byte[] song_right = new byte[fa.Length]; int p = 0; for (int c = 0; c < 43; c++) { song_left[p] = header[c]; p++; } int q = 0; for (s = startByte; s < length; s = s + 3) { song_left[s] = sLeft[q]; q++; s++; song_left[s] = sLeft[q

Convert sound file into wav with specific bitrate and cut specific part of the file

删除回忆录丶 提交于 2020-01-14 05:37:06
问题 I have some sound file(basically mp3 but it can be of any bitrate). I need to method to extract specified part of input file(not more than 40 seconds) into 8 bit mono wav output . I would appreciate any help or advice in choosing java library to do that. 回答1: You can use JavaLayer to decode mp3 into wav. Cutting a 40-second clip from a wav shouldn't be a problem. You can find some hints about mixing stereo to mono here: http://www.jsresources.org/examples/SingleChannelStereoConverter.html

Background music in a php/html webpage

扶醉桌前 提交于 2020-01-14 05:23:15
问题 I used an iPhone to record a piece of piano music as .m4a format. I would like to chop it and convert it into a suitable format to be used as the background music in a php/html website. I have the following questions:- 1. what kind of format is the best (e.g. mp3, WAV, etc)? 2. shall I chop the .m4a followed by conversion, or shall I convert it to another format then chop? 3. may I just apply the file in the webpage, to produce a looping effect? but I worry about, after each refresh, the

Java Exception Reading Stream from Resource .wav

情到浓时终转凉″ 提交于 2020-01-13 18:26:29
问题 I guess my code is okay, and my .jar file its okay with the .wav inside it.. But when I try to load it using getResourceAsStream I get a error.. this is my error: java.io.IOException: mark/reset not supported at java.util.zip.InflaterInputStream.reset(Unknown Source) at java.io.FilterInputStream.reset(Unknown Source) at com.sun.media.sound.SoftMidiAudioFileReader.getAudioInputStream(Unkno wn Source) at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source) at operation

Audio file format issue in objective c

吃可爱长大的小学妹 提交于 2020-01-13 06:47:06
问题 I have written an audio WAV (have recorded my voice) file using AVAudioRecorder. The final file format is a WAV file. File was successfully saved and I can hear my voice. I want to send this file to a back End server (web-service). But my server accepting only data and FMT information in WAV . It is not accepting my wav file because of my wav file infromation with FLLR, data, FMT. I have checked my WAV file information in Riffpad tool. It's showing FLLR, data, FMT. But I want only data and