×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224

    Increase volume using CMdaAudioRecorderUtility

    Hi folks,

    I have implemented a AudioPlayer example which plays AMR file. It shows the volume indicator icon on the status panel while it's playing.

    By left/right key, I would like to decrease/increase sound during playing the sound. There is a SetVolume method in CMdaAudioRecorderUtility class.

    I would really appreciate if anyone give an example how I can do it.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165
    just have a TInt variable in your container class, that takes values between 0 to 10. Then in your offerkeyevent function, change the value according to left/right arrow keys.

    When changing the value pass it to your recorder class, and use the Setvolume function to set the volume. Just remember before setting it to calculate the real value by multiplying the MaxVolume with your volume value, and then dividing it with 10.

    yucca

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224

    Increasing sound volume is solved now.

    It's working now. The solution is in below:

    const TInt KMyMaxVolume = 10;

    void CAudioPlayerEngine::ControllVolume(TInt vol)
    {
    iAmrPlayer->SetVolume(iAmrPlayer->MaxVolume() * vol / KMyMaxVolume );
    }

    I call this method from my container class for left/right key press and sending the apropriate values from [1-10] as vol argument.

    I wonder if it is possible to change the volume icon to mute volume icon when the volume is mute.

Posting Permissions

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