Wednesday, November 21, 2007

American Style Football Jacket

8) Fifth (use of sound and MP3)

  • WARNING! !

    This guide has been created following a logical thread and trying not to repeat what has already been discussed in previous chapters. So if overridden chapters going too fast, you risk having to set up a mess on his head and as a result of failing to learn what you wanted. Having said that go!

  • This lesson is a brief explanation of how to play sound and music on your psp. The sound FX and background music are two elements that give an application look different and therefore should not be overlooked, as is aspesso. Often this is caused by the fact that many programmers do not see the 'time to release your program, or simply because know how to implement sound in their applications. I hope this guide will help in the 'help programmers to put the sound in their applications. The first thing we do is remove the library "libmad" with svn, as we did with the libraries' s use of images.


    libmad is an MPEG audio decoder released under the GPL. This library has been ported to PSP by John_K. Then we open our usual terminal and type:


    svn checkout svn: / / svn.ps2dev.org/psp/trunk/libmad

    You should see a large numbers of files. After just enter the folder with the command "cd libmad" and start to compile it and install it. Then type:


    make


    If "make" it returns error, as has happened to me, just go to the folder "libmad". In here look for the folder called "src" and enter it into. Now edit the Makefile in this directory with a text editor. So now look for the line "PSPSDK = $ (shell psp-config - pspsdk-path)" and replace it with this 'other line' PSPSDK : = $ (Shell / usr / local / pspdev / bin / psp-config-pspsdk-path) ". Then look for the line "PSPDIR = $ (shell psp-config-psp-prefix)" and replace it with "PSPDIR = $ (shell / usr / local / pspdev / bin / psp-config-psp-prefix)."

    • Then we type in the terminal (with root privileges):


    cd / usr / bin


    sudo ln / usr/local/pspdev/bin/psp- gcc
    • sudo ln / usr / local / pspdev / bin / psp-ar


    sudo ln / usr / local / pspdev / bin / psp-ranlib


    These commands are only there to create links to executable files we need. We do this to avoid having to install the script to write the entire path of each one of these files. In fact, now just:

    • make

    • Now we type "make install", but unfortunately the script contains errors and would not do what we want, then type (or after in its place):

    sudo cp-Rf. / include / usr / local / pspdev / psp /


    sudo cp-Rf. / Lib / libmad.a / usr / local / pspdev / psp / lib


    • Alro With these commands do not do that manually copy the libraries in the right position . Now these libraries are installed and are ready to be used by our compiler toolchain psp!


    We then create two files, as nominiamoli down inside and copy the contents of the document that opens next to the relevant file:


    • mp3player.h ( http:// docs.google.com / Doc? id = d5273gq_13dgbtwz )

    • mp3player.c (

      http://docs.google.com/Doc?id=d5273gq_14cgq5d4
    • )


    These libraries were obtained from the "John_K's PSPMediaCenter. By changing some of his sources. Now we create the usual file "main.c" with an edited text and begin!

    The guide continues here:

    http://docs.google.com/Doc?id=d5273gq_155mtmj9

    0 comments:

    Post a Comment