Search code examples
androidsoundpool

SoundPool audio stream type?


I have one question. Can i use any of audio stream type (STREAM_MUSIC, STREAM_RING, STREAM_ALARM, STREAM_SYSTEM, etc..) on my SoundPoolActivity, to control SoundPool audio volume from example, "Alarm volume". Using

SoundPool = new SoundPool(1, AudioManager.STREAM_ALARM, 0);

Solution

  • STREAM_ALARM        The audio stream for alarms
    STREAM_DTMF         The audio stream for DTMF Tones
    STREAM_MUSIC        The audio stream for music playback
    STREAM_NOTIFICATION The audio stream for notifications
    STREAM_RING         The audio stream for the phone ring
    STREAM_SYSTEM       The audio stream for system sounds
    STREAM_VOICE_CALL   The audio stream for phone calls
    

    refer this link : https://stackoverflow.com/a/24655221/1660986 and http://developer.android.com/reference/android/media/AudioManager.html