How to overlap multi mp3 files to one mp3 file with ffmpeg? - merge

Hi all
I have multi mp3 files, each file have difference sound. Now i need overlap all of them to one file to have a mp3 file with all other sound. Can i do that with ffmpeg or other tool?
Thank for your help.

IMO, can't be done with ffmpeg.
I would decode all mp3 to .wav files and use Audacity to mix all sources to a single stereo .wav. Then, you can easily reencode this to mp3.
Audacity

Related

Video Karaoke Development on iPhone

I have a karaoke app that takes mp3+g files and mixes in the mic (using audio units)... and is able to record the final results to a raw pcm file.
I have potential clients asking me if I can do the same with a karaoke video file. So, can I...
1) playback a video and mix in the microphone audio?
2) take #1 and record it to a video file?
3) possibly even take the video camera and microphone inputs, and video audio... and save this to a file?
Thinking about this can I... take an mp3, camera and microphone inputs and mix all of these to a video file?
Thanks for any feedback!
Brian
Yes, all of these are possible. With the CD+G format, you will be a lot better off converting those to h.264 on the desktop and then loading them as movies with an AAC audio track. Attempting to write a CD+G parser for iOS would be a nightmare since so many CD+G files are badly broken. Also, CD+G files are shocking large, much larger than the MP3 files because CD+G is dumb uncompressed video from the 80's. It is a silly format.

which sound format is best for cocos2d game project?

i am new in cocos2d and facing hard time to find the best file format which is supported in cocos2d ?
and can i use ogg file format if Yes then please any link how to use it is cocos2d
No ogg on iOS. Here's the AVAudioPlayer supported audio formats list.
You also have to differentiate between background audio (streaming audio) and audio effects. For the former you should use mp3 and play only one mp3 at a time because the iOS devices can only decode one mp3 at a time using hardware. Additional mp3 are decoded with the CPU.
For audio effects uncompressed .caf and .wav files are standard. You want them to be 16-bit, mono and using a sample rate of 11, 22 or 44 kHz depending on the quality you need. Personally I would default to 22 kHz.
Here is the way to convert audio to best iOS formate: Click HERE
Open terminal and run this command:
afconvert -f caff -d LEI16 sound.wav
Any file that are supported in iPhone but for me .wav files are better.

iOS: Record audio in other format than caf

I am working on audio recording. I am able to record my audio in caf (Core audio format). Now I want to record sound in .mp3 or .amr.
I tried a lot of google but didn't found anything. I am not sure if my steps following work:
Write that Audio with .caf extention to document dir
Read data from that file
write the file again with .mp3 or .amr extention
I have 100% doubt that this will not going to work as this will just re save file with some other extension. This won't change audio codec.
I thought that for converting any format whether it is audio or video we need to change its codecs and data sequence.
Please also suggest me any player which don't play .caf files not anything else. So I can make sure that my files are converted successfully.
UPDATE Please also let me know that the way I am re-writing data with different extension is correct in the way I am needed?
You might be interested in the iPhoneExtAudioFileConvertTest example.
The MP3 format is however not available due to patents, maybe you can use LAME.
From the Document The Basics: Audio Codecs, Supported Audio Formats, and Audio Sessions

How to convert a wav or caf audio file on iPhone

I am working on a iPhone IM app, which support audio message. I've tried caf and wav format follow "Speak Here", but the files are too large to be send through the internet. So I'm wondering if I can convert any of them to some small format, like mp3 or amr.
Thank you for you help in advance.
CoreAudio has som great built-in datatypes for just this Core Audio Data Types
Use iLBC, short for Internet Low Bitrate Codec, to record your audio. Limit your sample rate to 8kHz.
If you insist on mp3, use LAME - the open source MP3 encoder library to convert your audio.
After you've recorded the audio file, the iOS AVFoundation AVAsset Reader/Writer APIs can be used to convert the file by, say, reading a .wav and writing AAC or other compressed file type.

combine two .caf audio files into a single audio file in iphone

I am using AVAudioRecorder for recording audio in .caf format. When the user will resume this recording the new recording must append with the old recording. So how can i combine two .caf audio files.
You can do it using ExtAudioFileService. In ios developer library they had provided two examples to convert one audio file to another format. In these they are opening one audio file for reading and another file for writing (converted audio). You can change or updated code to read from two files and write them to one out put file in same format(caf) or compressed format. First you have open first audio file and read every packets from it and write it to a new audio file. After finishing first audio file, close the file and open second audio file for reading. Now read every packets from second audio file and write to newly created audio file and close second audio file and new audio file.
Please find the links(1,2) for these sample codes ....
Hope this helps you...and good luck. :)