How to change mp3 bitrate ? (Delphi) - delphi

how can i change the constant bitrate(CBR) of mp3 files ? (such as 64kbps - 128kbps - 192kbps)

BASS is a good library for sound handling.
It includes wrappers for Delphi.
Reencoding involves decoding the MP3 files, then encode in a different bitrate.
BASS can natively decode MP3 files and streams.
BASS has encoder-wrappers for various encodings (using external encoders) for instance using LAME for MP3 encoding (the easiest is to pick download a precompiled Lame Bundle).
BASS licensing is free for non-commercial use.
They have a great forum for support.
--jeroen

You need to re-encode the mp3. Since I know of no good mp3 codec written in Delphi you'll need a wrapper around a c library such as lame.
If you have access to the original audio-data (Wave, FLAC,...) then you better encode from the lossless to the new bit-rate since chaining lossy encodes reduces the quality.
You might also need to look into the mp3 licensing terms. Some kinds of usage are free, but you need to pay for others.

Related

What kind of audio file should i use for iOS Apps?

I'm working on an app that will play several audio files. I have gotten that to work, having no trouble. But I'm not sure what file format to use. Right now I am using .wav and one .mp3. Is there a file type that is recommended? I don't know how the app is packaged for the App Store; should the audio be compressed or uncompressed?
Thank you!
It depends on what you're trying to accomplish.
Personally, I favor compression unless quality is an issue. Mp3s, while lossy is my preferred default. It's a standard file type, easy to work with, it can be high quality and iPhone/iOS is efficient at decoding.
However, if you need higher quality, AAC or uncompressed can be better. It's also possible for an mp3 to take a fraction of a second before it starts to play due to decoding. That may or may not be an issue if your audio is tied to a UI event.
An app bundle is the most common way of packaging the executable code(though not the only way.)
I will recommend you to read the following to know about how the bundle structure is.
https://developer.apple.com/library/ios/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1
With regards to the audio file format, There is no favourite as such for apple. You can find the preferred list of audio formats as:
https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html#//apple_ref/doc/uid/TP40009767-CH2-SW9
Hope this solves your problems.

IOS: Good way to add XMP metadata to AAC encoded m4a file?

I'm creating an AAC encoded m4a file from raw PCM samples for streaming purposes. I'm using AAC hardware encoding provided in this example. iPhoneExtAudioFileConvertTest
Now I would really want to add metadata such as album artwork and titles.
As I understand m4a or mp4 containers are MPEG-4 Part 14. So the specified metadata format is XMP. However I do not know the good tool for working with XMP metadata. Any ideas?
I'm aware of Adobe XMP SDK, but it seems quite heavyweight, maybe there is a better solution for iOS. I mean, I doubt that it's possible to do in AVFoundation, as XMP is Adobe technology, but maybe someone wrote a nice library especially for this purpose.
I don't know in what terms you think XMP SDK to be a heavyweight.But I can assure you that it hardly takes 15 mins to download, compile and start using the SDK.
You could start by editing one of the Samples(Modify) that come with XMP SDK and then use the snippet inside your application.

Libraries for compressing and saving sound in iOS

I wish to export a sound recording on iOS from an app into some kind of format that's suitable to be sent over email. Since this leaves a compressed format this leaves out uncompressed wav, and leaves a choice of mp3, ogg, m4a..
What readily available libraries (or even APIs) are available in iOS to do this task?
AVFoundation will do the job for you. In particular, you should look at AVExportSession, which is explicity written for encoding pcm into mp3 or m4a. Sorry, no ogg here. This stuff was available since iOS4.

Best format to store audio

I've got an app that enables end-users to upload their audio files. Mostly songs/music. Currently, I am using Zencoder for my encoding service, which allows .mp3, .m4a, .mp4 or .ogg
When a user uploads an audio file, it will be available for other users to listen too via the app as well. Would the mp3 format be suitable enough for this?
The licensing should be a major concern here. mp3 has some interesting licensing conditions based on whether your service is free to the end-user. Too complicated to go into length here, you can look it up on the web or contact Frauenhofer for more details.
The second obvious concern is bandwidth and audio quality. The sampling has to be high enough that the end-user cannot tell the audio has been limited or compressed, but the file still needs to be small enough that the file can be downloaded or streamed quickly. Any broadband connection these days can handle a 320kbps mp3 fairly easily.
Hopefully this will give you some good starting points for research:
wikipedia:Comparison_of_audio_formats
mp3 would suffice, mp4 would be better as it offers improved sound quality and compression over mp3. Ogg is a good format but has less broad support on players.
To state the obvious, the quality of the sound is very much dependent on the original file uploaded by the user. You will never improve on that quality, and each time you transcode between formats, you will degrade the quality.
If you ask people to compare between mp3, AAC (m4a, mp4) and ogg - they will give you different answers. Different codecs with different bit rates produce different audio print. Some claim that for certain specific music types you should prefer one format over another.
You can google different bit rates and comparisons easily - technical part is easy.
I would go for ogg. Here's why:
1) It's easily good enough for the job
2) It's an Open Source
3) You don't get into trouble (legally) using it together with upload encodings.

Selecting a Video Encoder for Windows

My software encodes videos using the standard Windows AVIFile functionality. That means, it can use all the DirectShow Codecs that are installed.
I recommend my users to download the XVid Codec themselves, but that's inconvenient.
I cannot bundle XVid since my software is not GPL. Is there any good direct-show-compatible video codec that can be redistributed with a commercial application? Requirement: The videos must look great on YouTube.
If not, I could switch from AViFile to another library (e.g. FFMpeg). But I'd like to avoid that if possible.
Thanks! :-)
Edit: The videos are computer animation with very sharp details (explosions and sparks). The video should be high-bitrate.
Theora is an excellent open source codec with very good DirectShow support. You also might consider google's newer WebM codecs. You dont say what kind of video you are distributing (from a camcorder, animation/computer rendered graphics, etc), so some of the choice of codec may depend on the exact nature of your video.

Resources