Android MediaPlayer.Create() returns null
Your file uses WAVE 8,000Hz MP3 8 kbit/s format, while android supports only 8- and 16-bit linear PCM: http://developer.android.com/guide/appendix/media-formats.html. Try fixing your file.
Your file uses WAVE 8,000Hz MP3 8 kbit/s format, while android supports only 8- and 16-bit linear PCM: http://developer.android.com/guide/appendix/media-formats.html. Try fixing your file.
from pydub import AudioSegment from pydub import effects root = r’audio.wav’ velocidad_X = 1.5 # No puede estar por debajo de 1.0 sound = AudioSegment.from_file(root) so = sound.speedup(velocidad_X, 150, 25) so.export(root[:-4] + ‘_Out.mp3’, format=”mp3″)
OK, I am answering my own question if it helps someone else. After few days of tireless trying, at last i have got it working. Below is a complete Function written with Objective-C and C. It takes a file path as a parameter which contains RAW PCM data directly captured from microphone and returns a … Read more
I have used this in the past for going from Wav -> byte[] and byte[] -> Wav package GlobalUtilities; import java.applet.Applet; import java.applet.AudioClip; import java.net.URISyntaxException; import java.util.logging.Level; import java.util.logging.Logger; import java.io.*; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import javax.sound.sampled.*; /** * This class handles the reading, writing, and playing of wav files. It is * … Read more
In my case Chrome records audio at 96kHz and Firefox at 44.1kHz, that makes huge WAV files. I implemented a downsampling function inside recorderWorker.js where you can select the sample ratio you want, like 16000. function downsampleBuffer(buffer, rate) { if (rate == sampleRate) { return buffer; } if (rate > sampleRate) { throw “downsampling rate … Read more
The SoundPool is the correct class for this. The below code is an example of how to use it. It is also the code I use in several apps of mine to manage the sounds. You can have as may sounds as you like (or as memory permits). public class SoundPoolPlayer { private SoundPool mShortPlayer= … Read more
OK, I’ve got this figured out. This post was crucial in helping me: http://computermusicblog.com/blog/2008/08/29/reading-and-writing-wav-files-in-java Basically, I used ByteArrayOutputStream to write the raw PCM data from AudioRecord, which then lets me get the byte array and its size when the process is done. I can then use that data in conjunction with the SampleRate, BitRate, and … Read more
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 … Read more
You’re on the right track. Let’s take a look at your example: for(int i = 0; i < data.Length; i++) data[i] = (byte)(256 * Math.Sin(i)); OK, you’ve got 11025 samples per second. You’ve got 60 seconds worth of samples. Each sample is a number between 0 and 255 which represents a small change in air … Read more
..any ideas how to fix this exception, .. Since WAV is a container format, it might include any number of encoding internally. ..wav files can be encoded with a variety of codecs to reduce the file size (for example the GSM or MP3 codecs). See the Java Sound info. page for details no how to … Read more