Categories: Java | How To | Multimedia | Audio | MMAPI (JSR-135) | Code Examples
This page was last modified 10:11, 27 June 2008.
MIDlet volume control in Series 40 and S60 devices
From Forum Nokia Wiki
In general, in MIDlets volume is controlled by using MMAPI’s VolumeControl and its getLevel() and setLevel() methods. For example:
VolumeControl vc = (VolumeControl)player.getControl("VolumeControl"); if (vc != null) vc.setLevel(100);
Devices might have their own volume keys for controlling the volume level. Java implementations in older Nokia phones don’t support changing volume by using these keys, but latest models do. This is supported in S60 3rd Edition FP2 (and newer) and Series 40 5th Edition FP1 devices (and newer).
Some more details about volume control support in S60 3rd Edition FP2 and in Series 40 5th Ed. FP1:
- If the phone model has external volume keys present, then those keys can be used to control the volume of MMAPI Players.
- The keys work in this way when a MIDlet that uses MMAPI is on foreground. They change the volume level for MMAPI Players globally, that is, the volume level of every Player in every MIDlet is altered.
- In Series 40 5th Ed. FP1 devices a visible indicator is shown to the user, when volume is adjusted by using external volume keys.
- In S60 3rd Edition FP2 devices the volume level change made by using volume keys is not visible to the user.
- The volume changes made by external volume keys are not visible to the midlets, so there are no PlayerListener.VOLUME_CHANGED events or changes in the level of VolumeControl.
- It is not possible to get any key events from these external volume keys.
- In S60 3rd Edition FP2 the volume level set using external volume keys stays effective even if the phone is restarted.
- In S60 3rd Edition FP1 (and older) devices VolumeControl.getLevel() initially returns value 100 if the volume level of the player has not been set using VolumeControl.setLevel() method.
- In S60 3rd Edition FP2 devices VolumeControl.getLevel() initially returns the default volume level (decided by the underlying implementation), if player volume level has not been set using VolumeControl.setLevel().
- Note, that volume keys control global volume and MMAPI VolumeControl controls MIDlet’s own volume. The actual volume that is heard by the user is the global volume in proportion to the Volume Control. For example:
- If the global volume scale is 1-10 and it is set to value 6. If the level of VolumeControl is 100 (=max) then the output is 6. If the level of VolumeControl is 50 then the output is 3. So there can be situations, where MIDlet volume is set to maximum level (100), but still nothing is heard. That situation happens when the global volume value is 0.
- Note that in S60 devices sounds played by a MIDlet are not heard, if profile setting "Warning sounds" is set off. This setting can be found (in N95 8GB) from: Menu -> Tools -> Profiles -> General -> Personalise -> Warning tones.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Limitation of RMS | kitkatrobins | Mobile Java General | 2 | 2006-08-03 18:41 |
| Midlet is not working on the Nokia | bartwell | Mobile Java General | 4 | 2008-06-02 12:54 |
| About RMS Data | MananW | Mobile Java General | 6 | 2006-05-11 10:32 |
| Serial COM port connection with 3220? | antonio.cayres | Mobile Java General | 3 | 2007-09-14 14:30 |
| Symbian UID | prakashs | General Symbian C++ | 4 | 2006-12-19 09:19 |
