Which sound libary should I use

Shay

Well-Known Member
Licensed User
Longtime User
Hi

my requirements are:
1. Need to run sound files in a row (playlist)
2. Option to mix (start second file x time before first is over)
3. Option to speed sound (play sound faster)

which can I use?
 

stevel05

Expert
Licensed User
Longtime User
The only thing we have at the moment that will change the speed of audio is soundpool which also changes the pitch, although there is a limit to the file sizes and is more suited to games.

Somebody did post a wrapped BASS library, some implementations of which include time stretching and pitch shifting, but last time I looked the download had been removed (it was external to the forum).

Audiotrack will be able to do the other two of your requirements but only works with raw audio, so if you want to use MP3's or ogg's etc you'll have to convert them first.

The android support for Audio is getting better, apparently from 4.2 (if I remember correctly) we should have access to the inbuilt codecs, which should permit access at the required level to use them with the audiotrack library, but I don't yet have the right hardware/OS to try it out. (this will need a library to make it accessible to Basic4Android).
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
You should be able to mix audio files with audiotrack although I've not tried it, but is should be as simple as adding the two arrays together minus the header data if you have a wav file. They will need to be the same format (8 or 16 bit), and you will probably have to divide the results to average them to stop digital clipping depending on the levels of the original files, then recreate a header to save as a new wave.

A quick search of Google showed there are some articles on there that will probably be of use if you need them.
 
Upvote 0
Top