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
[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 - Sound control java + ndk

Sound control java + ndk

All your problems with Audio, Video and Images.

Sound control java + ndk

Postby timoshenko_av » Thu Jan 20, 2011 2:03 pm

Hello!
Before startings my ndk part of application i remember old volume state and set it to maximum(i do this because i want sdl control sound volume without limits),
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
  3. int oldMusicVolume = am.getStreamVolume(AudioManager.STREAM_MUSIC);
  4. am.setStreamVolume(AudioManager.STREAM_MUSIC, am.getStreamMaxVolume(AudioManager.STREAM_MUSIC),0);
  5.  
  6.  
Parsed in 0.011 seconds, using GeSHi 1.0.8.4


and when ndk close restore old music volume
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. am.setStreamVolume(AudioManager.STREAM_MUSIC, oldMusicVolume,0);
  3.  
  4.  
Parsed in 0.011 seconds, using GeSHi 1.0.8.4


If my app unexpectedly terminate, and i dont restore old sound volume users settings will be lost.
Does someone know how can i implement this feature using another more properly way?
Much thanks!
timoshenko_av
Freshman
Freshman
 
Posts: 8
Joined: Tue Oct 05, 2010 10:02 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 4 guests