wav

Create a .WAV file from Unity AudioClip

↘锁芯ラ 提交于 2019-12-25 00:33:54
问题 So the problem is i want to create a .wav file from an Audioclip but i can't figure out how to do it. I've been looking for how a .wav file structure is but i'm not able to understand it as well as i want (Also i don't get how to get all the data from an Audioclip and convert it into bytes and set it to the file). Here's what i've been trying so far: public static bool ToWAV(this AudioClip audio, string path) { try { int samples = audio.samples; int channels = audio.channels; int sampleRate =

How to calculate the decibel of audio signal and record the audio in java?

跟風遠走 提交于 2019-12-24 21:43:42
问题 public TargetDataLine targetDataLine; private static AudioFormat getAudioFormat() { return new AudioFormat(16000, 16, 2, true, false); } AudioFormat a = getAudioFormat(); DataLine.Info info = new DataLine.Info(TargetDataLine.class, a); targetDataLine = (TargetDataLine) AudioSystem.getLine(info); targetDataLine.open(a); targetDataLine.start(); AudioInputStream ais = new AudioInputStream(targetDataLine); AudioSystem.write(ais, AudioFileFormat.Type.WAVE, new File("record.wav")); How can i

play a raw PCM byte from a wav file

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 16:27:26
问题 I have a wav file which was encoded with 16-bit PCM, I want to convert it to a PCM short array and play the raw array with audiotrack class. It is what I did: String fileName = "test.wav"; File f = new File(baseDir + File.separator + fileName); InputStream is = null; try { is = new FileInputStream (f); } catch (FileNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } BufferedInputStream bis = new BufferedInputStream (is, 8000); DataInputStream dis = new

Importing a .wav file in c# and extracting the signal an array of doubles

北慕城南 提交于 2019-12-24 10:52:09
问题 I'm doing a project on audio signal processing and I need to import a wav file in c# and extract an array of doubles or floats that contains the signal data. Most of the tutorials for audio libraries I've found don't seem to do stuff this low-level. Any help would be appreciated, thanks. 回答1: http://www.codeproject.com/KB/audio-video/PlayWavFiles.aspx this site helped me, but the .exe file became very large due to the imported wav files. So sending the project via email will be a problem. :)

Append .pcm audio raw data into wav (in C)

自古美人都是妖i 提交于 2019-12-24 10:03:18
问题 After searching on google for a long, I was unable to find some answers. So,I thought to put question on stackoverflow. I can't share code here due to company policies but I can share links from where I get knowledge. So, what I am trying to do from couple of days - Converting .pcm file to .wav file format. I am sharing some links about wav header and how I design the struct wav and then write that header in .wav file after this I want to append .pcm raw data after writing the wave header but

ByteString representation of a Double conversion

偶尔善良 提交于 2019-12-24 09:12:35
问题 I'm writing my own WAVE parser that uses Conduit so I can stream values, one by one, through a pipeline. I get a sample from a .wav file via hGet (n is the number of bytes per sample for that wav file): bytes <- hGet h n This gives me a ByteString with a representation of the Double value of the sample. E.g.: "\131\237\242" represents -0.10212671756744385 "g\238\242" represents -0.10209953784942627 "\215\238\242" represents -0.10208618640899658 . The possible values are between -1 and +1. Is

Get Mean amplitude(only) of .wav from sox

那年仲夏 提交于 2019-12-24 03:17:55
问题 C:\Program Files\sox-14-4-0>sox Sample.wav -n stat The above code gives below result Samples read: 26640 Length (seconds): 3.330000 Scaled by: 2147483647.0 Maximum amplitude: 0.515625 Minimum amplitude: -0.734375 Midline amplitude: -0.109375 Mean norm: 0.058691 Mean amplitude: 0.000122 RMS amplitude: 0.101146 Maximum delta: 0.550781 Minimum delta: 0.000000 Mean delta: 0.021387 RMS delta: 0.041831 Rough frequency: 526 Volume adjustment: 1.362 Now i need only Mean amplitude. How to do that? 回答1

Value Error occurs when filtering wav file

随声附和 提交于 2019-12-23 23:01:58
问题 We are currently integrating three codes 1. Mic recorder 2. Integrator (Low-Pass filtering) 3. Applying the filter We encountered this error: fltrd() [[ 0 0] [ -1 0] [ 0 0] ..., [-65 -60] [-31 -52] [-45 -53]] Traceback (most recent call last): File "<ipython-input-2-72cbac6fd2ac>", line 1, in <module> fltrd() File "C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT/etc/project.py", line 57, in fltrd a2 = integ(x) File "C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT

How to play a wav file in Ruby?

守給你的承諾、 提交于 2019-12-23 20:03:55
问题 What is a good way to play an audio file from Ruby that is wav format? OSX or Ubuntu... Ruby 1.9.3 回答1: I've used Gosu to play audio in a simple game context, so I imagine it would work fine for you... @tune = Gosu::Song.new(window, "tune.wav") @tune.play(true) 来源: https://stackoverflow.com/questions/14993412/how-to-play-a-wav-file-in-ruby

embedding sound in executable in C++

半腔热情 提交于 2019-12-23 18:20:39
问题 how can I store sound in my executable file? Let's pretend I have function x to play sound located in C:\sounds, how can I store sound.wav inside of executable? do I have to read it byte by byte and hardcode it in some variable, then create file and play it when user executes my file? 回答1: I would advice hardcoding the contents of the .wav in some variable and then play it's contents using 'sndPlaySound' with 'SND_MEMORY' option as in this example supplied by Microsoft: http://support