Android Community
Results 1 to 2 of 2

Thread: Problems with Soundboard / Audacity / Converting to OGG / Playback

  1. #1
    Join Date
    Mar 2010
    Posts
    1

    Default Problems with Soundboard / Audacity / Converting to OGG / Playback


    Hello,

    I am currently making a soundboard with a standard template from myandroidsoundboard.com - I am having a problem with some of the files. I take the mp3 file and convert it in Audacity to OGG files. When it is loaded into the soundboard res/raw folder and I then run the emulator it will play the song for roughly 2-3 seconds.

    I was advised to convert the OGG file to 16 bit 11025HZ, but when I do this (tv show theme song for example) or any file for that matter becomes REALLY SLOW!

    Has anyone ran into this problem before? I have searched everywhere and I am unable to find a solution.

    Thank you.

    edit: I am using up to date version of Eclipse.

  2. #2

    Default Re: Problems with Soundboard / Audacity / Converting to OGG / Playback


    I tried using that site and code for a soundboard but found it was no good at all, sounds will repeat endlessly for as many button clicks as you press, I'd avise you to use media player if you're looking to create a sound board.

    Add MediaPlayer FilmSound;

    just under your class

    public class Soundboard extends Activity {
    MediaPlayer FilmSound;

    like so, remembering to import the media player with ctrl shift and o

    then add

    Button dollar = (Button)findViewById(R.id.Dollar);
    FilmSound = MediaPlayer.create(getApplicationContext(), R.raw.buythat);
    dollar.setOnClickListener(new OnClickListener() {
    public void onClick(View v) {
    if (FilmSound.isPlaying())
    {
    FilmSound.stop();
    FilmSound.reset();
    FilmSound = MediaPlayer.create(getApplicationContext(), R.raw.buythat);
    FilmSound.start();
    }
    else {
    FilmSound = MediaPlayer.create(getApplicationContext(), R.raw.buythat);
    FilmSound.start(); }
    }
    });

    dollar being the button id, so change to your own, for some odd reason, my code needs to have the film sound variable three times for one of the sound samples, otherwise crashes out.
    You can now use samples at any rate you like.

    The reason it slows down is the frequncy is reduced, so you're stretching the sound out, like a bit of toffee.

Similar Threads

  1. Dr. Who soundboard/images
    By phulingyu in forum Developers Guild
    Replies: 0
    Last Post: 03-01-2010, 10:07 AM
  2. Replies: 0
    Last Post: 10-16-2009, 07:19 AM
  3. Converting movies for Hero playback?
    By roakes in forum General HTC Chat
    Replies: 5
    Last Post: 08-03-2009, 11:04 AM
  4. Mp3/mp4 playback problems with security update
    By Iceberg in forum General Phone Chat
    Replies: 0
    Last Post: 07-19-2009, 07:47 PM
  5. Replies: 1
    Last Post: 07-04-2009, 08:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •