Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Mediaplayer + Audioflinger problem

Mediaplayer + Audioflinger problem

All your problems with Audio, Video and Images.

Mediaplayer + Audioflinger problem

Postby Grendizer » Sat Mar 05, 2011 3:15 pm

Hi all

I have a dialpad that contains imagebuttons, and when ever a button is clicked a sound is played.
So if number one is pressed a file will be played saying "One". For this purpose i'm using mediaplayer.
The thing is if I press a button multiple times, I'll get an error saying the following:
AudiotTrack: AudioFlinger could not create track, status: -12
AudioSink: Unable to create audio track
Mediaplayer: error(-19, 0)
Mediaplayer: Error(-19, 0).

For each onclick event i send the mediaplayer and the file to a method...here's an example:

Button nr. 1
Code: Select all
ImageButton one = (ImageButton) findViewById(R.id.btnOne);
      one.setOnClickListener(new OnClickListener() {
         public void onClick(View v) {
            playSound(mp, R.raw.mamacita_one);            
         }
      });


Method for playing sound:
Code: Select all
private void playSound(MediaPlayer mp, int tone) {
      if(mp != null) {
         mp.stop();
         mp.reset();
         mp.release();
         mp = null;
      }
      mp = MediaPlayer.create(this.getApplicationContext(), tone);
      mp.start();            
   }


I'd appreciate any help here...
Grendizer
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sun Mar 14, 2010 5:14 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests