I need to complete an app on an Android phone that plays back four sound files when four separate buttons are pressed.
The trouble I have is that the sound files are .wav files. They are also stereo files. I need to play them on the Android phone uncompressed and in stereo.
My understanding is that .wav can not be played on Android phones as it is uncompressed and that I will need to convert the file format but I have not had any luck that way.
Any ideas?
Thanks!!
Android certainly can open/play WAV files.
Use android.media.MediaPlayer to play them, as you'd do for mp3 or other format.
See the following list for a complete reference of supported media formats: http://developer.android.com/guide/appendix/media-formats.html
Wave is supported, PCM/WAVE 8- and 16-bit linear PCM (rates up to limit of hardware) WAVE (.wav)
From Android 4.0.1 Android supports Wave (.wav) formats, you can access 8bit or 16 bit audio files in .wav format
Related
Since MediaRecoreder not supports encoding to mp3 format.
Can ffmpeg to record audio directly from Android audio source (how to specify this) or it only encodes one file to other format?
You mean using Android to record audio and save it as mp3?
If so, you can code mp3 using libmp3lame. And this is very useful.
Since Android Record outputs a pcm, liblmp3lame can use pcm as input and then output mp3 data.
I have found a solution for resampling an .mp4 video taken with the camera on the device to make it smaller (resizing by resolution, bitrate, and framerate). The problem is, it doesn't carry the audio over.
I have looked at several different options for trying to get the audio out of my source (large) mp4 and push it into my smaller mp4 and I can't not seem to get any of these procedures to work correctly.
I've tried the following:
1) extracting the PCM audio from the source using: How do I extractor audio to mp3 from mp4 using java in Android?
2) converting the PCM to M4A and then adding the M4A to the smaller MP4 using: https://github.com/tqnst/MP4ParserMergeAudioVideo/blob/master/Mp4ParserSample-master/src/jp/classmethod/sample/mp4parser/MainActivity.java
that's the method I got closest with but the audio was really slow and didn't match up at all with the video in the smaller mp4.
I also tried a "direct copy" from one mp4 to the other with a variation of this: Concatenate multiple mp4 audio files using android´s MediaMuxer
that made my smaller mp4 actually larger (in file size) than my source mp4 and it didn't actually move the sound over.
The android documentation for MediaMuxer is pretty terrible and I can't make heads or tails of what I need to do to get this to work. It seems like it should be a pretty trivial task....
any suggestions or advice would be greatly appreciated.
TIA
I ended up just using ffmpeg with this solution:
https://github.com/WritingMinds/ffmpeg-android-java
I am developing app, in which I want to :
Mix two audio files ( most probably .wav files ). Mixing here means, output file will sound like two audio files are being played at same time and not concat.
Adding audio to video.
Thanks in advance.
I need to play multiple audio track at a time from sd card. I was trying to play with SoundPool. But it does not support larger files.
I tried with AudioTrack but it needs pure PCM code. PCM code generation bit of complex from mp3 or 3gp file, as android do not have anything build in to that.
I've look OpenSL Engine, But did not find any good example or tutorial to work with it.
How can I play multiple audio at a time in loopy style? any idea, suggestion would be great a help.
How I can get an audio file recorded via iPhone to play back in Android.
I don't see iLBC codec listed in the decoder section of Android supported media formats
Looking at the iPhone list of supported audio formats: iPhone audio formats, it looks like if you're just going iPhone => Android, then AAC or PCM are your best bets for encoding on iPhone, decoding on Android.
You should record your audio on iPhone with AVAudioRecorder .wav format.
See this thread how to configure AVAudioRecorder to get wav format on iOS.
Good luck
In terms of a built-in capability you can check the documentation as easily as I can.
Assuming no built-in capability, if you have working java, C, or (with caveats) C++ code capable of decoding the file to linear pcm samples and no legal obstacles to using it, then you can write an application to do so.