wav

Extract Fast Fourier Transform data from file

半世苍凉 提交于 2019-11-30 23:33:48
问题 I am building a tool which is supposed to run on a server and analyze sound files. I want to do this in Ruby as all my other tools are written in Ruby as well. But I am having trouble finding a good way of accomplishing this. A lot of the examples I've found has been doing visualizers and graphical stuff. I just need the FFT data, nothing more. I need to both get the audio data, and do a FFT on it. My end goal is to calculate some stuff like the mean/median/mode, 25th-percentile, and 75th

How do i get a .wav sound to play?

[亡魂溺海] 提交于 2019-11-30 22:17:22
Im making an app, and i want it to make a sound when a activity is opened , the sound file is in R.raw.sound_file , if someone could do some example code to make my app play a sound that would be great. doesn't the android.media.MediaPlayer class do this? Reference: http://developer.android.com/reference/android/media/MediaPlayer.html Example: http://developer.android.com/guide/topics/media/index.html Step 2 of the example says: MediaPlayer mp = MediaPlayer.create(context, R.raw.sound_file_1); mp.start(); In your case, I'd use the onStart() inside your Activity class: public class MyActivity

Create valid wav file header for streams in memory

南楼画角 提交于 2019-11-30 22:09:32
I have raw-headerless wav audio data as MemoryStream s. Stream rawAudioStream = Producer.GetRawAudioFileStream(...); I know those streams data format: // WaveFormat(int rate, int bits, int channels); WaveFormat waveformat = new WaveFormat(8000, 16, 1); What I want is to add programmatically right header info for those memory streams without writing them to a physical file. How can I do that? PS: I checked the NAudio Library but only found a way to create a header by writing streams to really-physical files which is not suitable for my situation . var waveformat = new WaveFormat(8000,16,1); var

java pcm to wav

橙三吉。 提交于 2019-11-30 22:07:44
I have a pcm file, and I want to convert it to a wav file. Is there any suitable api or code for this? devflow it's My Code /** * Write PCM data as WAV file * @param os Stream to save file to * @param pcmdata 8 bit PCMData * @param srate Sample rate - 8000, 16000, etc. * @param channel Number of channels - Mono = 1, Stereo = 2, etc.. * @param format Number of bits per sample (16 here) * @throws IOException */ public void PCMtoFile(OutputStream os, short[] pcmdata, int srate, int channel, int format) throws IOException { byte[] header = new byte[44]; byte[] data = get16BitPcm(pcmdata); long

Reduce the volume of a Wav audio file using C

空扰寡人 提交于 2019-11-30 20:09:41
问题 I am writing a C program for editing a Wav audio file. I have loaded all file datas in an array of unsigned integer values (UINT16_T). Now, i would like to reduce the volume of the file. I thought it was enough to decrease the value (of a certain percentage) of the single values. But if i do that, i obtain an audio file with noise (I think I understand is called "static" or "click noise") Why? Which is the right procedure? Thank You! This is the piece of code affected: FILE* fp; FILE* fp2; /

Record into WAV file

不羁的心 提交于 2019-11-30 18:49:59
问题 Since I've posted this question, I've been trying to write a valid WAV file myself from raw PCM data. I've managed to write the FLAC converter (tested and works), but it does not encode the WAV files I've been writing. I'm not sure what I'm doing wrong. I've been scouring the internet looking at other individuals source code and comparing it to my own, but I still can't get it to work. Here is the whittled down source code (sorry it's still a bit long, it takes a bit of code to record to a

Is there any way to send audio file to the speech-to-text recognition

五迷三道 提交于 2019-11-30 17:26:10
I want the Android speech recognition system analysing audio file and not the default incoming voice from microphone. Is there any way to do that ? Thank you. I suppose it works in a similar way to the chrome api - http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/ As he has mentioned you can convert the microphone file into a .flac file and send it to the speech api, and you will get the same result. So you can use SOX and convert it yourself. Hope it helps. Dias cmusphinx.sourceforge.net/wiki/tutorialandroid Just found that link sounds like someone has created a android

Create valid wav file header for streams in memory

一笑奈何 提交于 2019-11-30 17:25:07
问题 I have raw-headerless wav audio data as MemoryStream s. Stream rawAudioStream = Producer.GetRawAudioFileStream(...); I know those streams data format: // WaveFormat(int rate, int bits, int channels); WaveFormat waveformat = new WaveFormat(8000, 16, 1); What I want is to add programmatically right header info for those memory streams without writing them to a physical file. How can I do that? PS: I checked the NAudio Library but only found a way to create a header by writing streams to really

How to play multiple .wav files simultaneously in delphi

家住魔仙堡 提交于 2019-11-30 16:26:34
I wish to multiple .wav files simultaneously in delphi. When I open and plat the first things are fine. However the second one causes a error when it tries to open. It would appear that i can only use one media player at a time.... is there any way around this what do i do? Andreas Rejbrand How would you play a single sound? When I want fine control, I use the waveOut functions, as in this answer . My answer there also allows you to play the sound using a thread (that is, among other things, asynchronically). I think that you can play two sounds at the same time, by simply starting two such

How can I resample wav file

眉间皱痕 提交于 2019-11-30 16:20:15
问题 Currently I'm recording an audio signal with following specs: Channels: 1 SamplesPerSecond: 8000 BitsPerSample: 16 How can I convert this .wav-file to eg following specs (pure c# is preferred): Channels: 1 SamplesPerSecond: 22050 BitsPerSample: 16 回答1: Windows API (one of) to resample audio is Audio Resampler DSP. This transform class is pretty straightforward to set up input and output types, then push input data and pull output. Another task you would possible deal additionally with is