I'm also very interested in this.  I'm also trying to slow down and
speed up mp3s though I don't mind pitch shift.  I wish there was just
an easy way to change sample rate in MediaPlayer.

On Mar 7, 9:39 pm, "David R." <[email protected]> wrote:
> In my continuing quest to slow down or speed up MP3s without altering
> the pitch, I came across mpg123.  I am now at the point where I can
> compile and run using the libraries, and I get decoded MP3s.
> (Hooray!)  Unfortunately, I'm at about 0.45x real-time on a G1, which
> isn't fast enough.  One guy was able to get 20x real-time using libmad
> (http://apistudios.com/hosted/marzec/badlogic/wordpress/?p=231) but
> I'd prefer not to use that since mpg123 is LGPL while libmad is GPL.
>
> I'm led to believe that the main advantage of mpg123 is the amount of
> code optimized by using assembly.  In particular, I want to use the -
> DOPT_ARM, but doing so gives the error:
>
> out/apps/decoder/android-1.5-arm/objs/decoder/mpg123/src/libmpg123/
> synth.o: In function `synth_1to1_arm':
> sources/decoder/mpg123/src/libmpg123/synth.c:537: undefined reference
> to `synth_1to1_arm_asm'
>
> This is my Android.mk file:
> #
> # Unless required by applicable law or agreed to in writing, software
> # distributed under the License is distributed on an "AS IS" BASIS,
> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> # See the License for the specific language governing permissions and
> # limitations under the License.
> #
> LOCAL_PATH := $(call my-dir)
>
> include $(CLEAR_VARS)
>
> LOCAL_MODULE    := decoder
> LOCAL_ARM_MODE  := arm
> LOCAL_SRC_FILES := media_decoder.cpp mpg123/src/libmpg123/libmpg123.c
> mpg123/src/libmpg123/frame.c mpg123/src/libmpg123/parse.c mpg123/src/
> libmpg123/id3.c mpg123/src/libmpg123/icy.c mpg123/src/libmpg123/
> icy2utf8.c mpg123/src/libmpg123/format.c mpg123/src/libmpg123/
> readers.c mpg123/src/libmpg123/layer1.c mpg123/src/libmpg123/layer2.c
> mpg123/src/libmpg123/layer3.c mpg123/src/libmpg123/optimize.c mpg123/
> src/libmpg123/synth.c mpg123/src/libmpg123/equalizer.c mpg123/src/
> libmpg123/dct64.c mpg123/src/libmpg123/tabinit.c mpg123/src/libmpg123/
> synth_real.c mpg123/src/libmpg123/synth_s32.c mpg123/src/libmpg123/
> stringbuf.c mpg123/src/libmpg123/compat.c mpg123/src/libmpg123/
> synth_arm.S
> LOCAL_CFLAGS    := -DHAVE_CONFIG_H -DFPM_ARM -ffast-math -O3 -DOPT_ARM
> -DNO_8BIT -DNO_NTOM -nostdlib -enable-int-quality -mandroid
>
> include $(BUILD_SHARED_LIBRARY)
>
> It compiles and runs fine if I change -DOPT_ARM to -DOPT_GENERIC and
> remove mpg123/src/libmpg123/synth_arm.S
>
> How can I decode MP3s at least as fast as real time without
> immediately playing them?  Really I need to be significantly faster
> than that, depending on how much I can optimize my slowdown code.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to