UIPickerView / Volume Control

Discussion in 'iOS Programming' started by bbrosemer, Feb 11, 2009.

  1. bbrosemer macrumors 6502a

    bbrosemer

    Joined:
    Jan 28, 2006
    #1
    Does anyone know a way to link a UIPickerView with Volume Control of the device?
     
  2. Pring macrumors 6502

    Joined:
    Sep 17, 2003
    #2
    It's not possible with the official APIs. The only way to control the actual device volume is MPVolumeView.
     
  3. bbrosemer thread starter macrumors 6502a

    bbrosemer

    Joined:
    Jan 28, 2006
    #3
    Ugh .... so is there a way to at least control my app's volume rather then the hardware itself... I know or I think you can while a sound is playing but can I change it pre a sound playing.
     
  4. Pring macrumors 6502

    Joined:
    Sep 17, 2003
    #4
    Yeah, you can do that. Depends how you're playing your sounds but there should be a method for setting the 'gain'. Use that to control volume.
     
  5. bbrosemer thread starter macrumors 6502a

    bbrosemer

    Joined:
    Jan 28, 2006
    #5
    Instead of that hassle what i decided to do was make 30 copies of the file with each varying sound levels... luckily the file was small so I load them into memory when they get called rather then as the app is loading ... So it works fine with no lag ...
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    So, you have a volume control, via UIPickerView, with 30 distinct volume settings?
     
  7. bbrosemer thread starter macrumors 6502a

    bbrosemer

    Joined:
    Jan 28, 2006
    #7
    Sorta I took a short sound .. which I wanted to vary the volume and whenever a different row in the picker is selected it chooses the sound that correlates to the volume i wanted aka I made the 30 sounds have different DB levels. Aka it is more of a pseudo way of doing volume control. Not how I wanted to do it but luckily since the sound file is small it works fine and without delay.
     

Share This Page