wav

Android MediaPlayer.Create() returns null

谁说我不能喝 提交于 2019-12-17 20:48:56
问题 I am developing an Android App that plays some sounds. For that I am creating an object of MediaPlayer. Below is the code: mp = MediaPlayer.create(this, R.raw.testSound); Here mp is null for Android 2.3.3 (API Level 10), i tried with other versions of Android (2.1, 2.2 etc.) it works fine. However with Android 2.3.3 (API Level 10) MediaPlayer.create() call returns null. The sound file (testSound.wav) is a wav file. I tried parsing the wav file to see if it is corrupted or not. It seems just

how to convert or record .wav file in 16khz 16bit mono little-endian?

自作多情 提交于 2019-12-17 20:24:53
问题 I m just implementing sphinx4 speech recognition in java..whta i need is how to record sound or convert any sound .wave file in to 16khz 16bit mono little-endian file. had search a lot for this..but no specific guidance i have got..hope anyone from stack overflow family can help me out or give me a proper guidance in that. 1). i need to just record audio in android with the 16khz 16bit mono little-endian file format in wave file or 2). i need to convert the prerecorded file with any sampling

Play wav file async multiple times with .net

余生颓废 提交于 2019-12-17 20:01:00
问题 I have an app that I need to play a wav file when a key is pressed, I use the SoundPlayer class but if another sound is being played when a new key is pressed, it stops the sound the play it again making it look ugly.... is there any way to play the same sound again even if there is another of being played? thanks! 回答1: Use PlaySound from the windows API in combination with the SND_ASYNC and SND_NOSTOP flags. http://www.pinvoke.net/default.aspx/winmm.playsound Usage //And the actual usage

Mean amplitude of a .wav in C#

荒凉一梦 提交于 2019-12-17 20:00:51
问题 Does anyone know a way to get the mean amplitude of a .wav file using C# (even if it means calling an outside command line program and parsing the output)? Thanks! 回答1: Here is a snip that reads in a stereo wav and puts the data in two arrays. It's untested because I had to remove some code (converting to mono and calculate a moving average) /// <summary> /// Read in wav file and put into Left and right array /// </summary> /// <param name="fileName"></param> private void ReadWavfiles(string

Concatenate two audio files in Swift and play them

天大地大妈咪最大 提交于 2019-12-17 19:25:13
问题 I try to concatenate .wav audio files in swift. Here is my code : func merge(audio1: NSURL, audio2: NSURL) { var error:NSError? var ok1 = false var ok2 = false var documentsDirectory:String = paths[0] as! String //Create AVMutableComposition Object.This object will hold our multiple AVMutableCompositionTrack. var composition = AVMutableComposition() var compositionAudioTrack1:AVMutableCompositionTrack = composition.addMutableTrackWithMediaType(AVMediaTypeAudio, preferredTrackID:

Can ffmpeg convert audio from raw PCM to WAV?

好久不见. 提交于 2019-12-17 17:29:55
问题 I can convert wav file to pcm ffmpeg -i file.wav -f s16le -acodec pcm_s16le file.pcm How can I revert this operation? 回答1: The wav container just adds a simple header to the raw PCM data. The header includes the format, sample rate, and number of channels. Since the raw PCM data does not include this information, you will need to specify it on the command line. Options are specified before the file they apply to, so options before the input file may be used to specify the format of the input

How to get PCM data from a wav file?

时光毁灭记忆、已成空白 提交于 2019-12-17 16:26:52
问题 I have a .wav file. I want to get the PCM data from that sound file, so that I can get the individual data chunks from the sound and process it. But I don't know how to do it. Can anyone tell me how to do it? I have done this so far: public class test { static int frameSample; static int timeofFrame; static int N; static int runTimes; static int bps; static int channels; static double times; static int bufSize; static int frameSize; static int frameRate; static long length; public static void

How can I draw sound data from my wav file?

旧城冷巷雨未停 提交于 2019-12-17 15:37:41
问题 First off this is for homework or... project. I'm having trouble understanding the idea behind how to draw the sound data waves on to a graph in Java for a project. I have to make this assignment entirely from scratch with a UI and everything so basically making a .wav file editor. The main issue I'm having is getting the sound data into the graph to be drawn. Currently I have a randomly generated array of values just being drawn right now. So far I have a mini-program running and validating

javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file when loading wav file

浪子不回头ぞ 提交于 2019-12-17 09:55:07
问题 i am using java 6 , and i am trying to load wav file, to get its duration as follows: public static double getAudioFileDuration(File file) { try { AudioInputStream stream = AudioSystem.getAudioInputStream(file); // At present, ALAW and ULAW encodings must be converted // to PCM_SIGNED before it can be played AudioFormat format = stream.getFormat(); if (format.getEncoding() != AudioFormat.Encoding.PCM_SIGNED) { format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, format.getSampleRate(),

Remove noise from wav file, MATLAB

狂风中的少年 提交于 2019-12-17 08:54:12
问题 I've only used MATLAB as a calculator, so I'm not as well versed in the program. I hope a kind person may be able to guide me on the way since Google currently is not my friend. I have a wav file in the link below, where there is a human voice and some noise in the background. I want the noise removed. Is there anyone who can tell me how to do it in MATLAB? https://www.dropbox.com/s/3vtd5ehjt2zfuj7/Hold.wav 回答1: This is a pretty imperfect solution, especially since some of the noise is