AudioAttributes.Builder.SetLegacyStreamType(Stream) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets attributes as inferred from the legacy stream types.
[Android.Runtime.Register("setLegacyStreamType", "(I)Landroid/media/AudioAttributes$Builder;", "GetSetLegacyStreamType_IHandler")]
public virtual Android.Media.AudioAttributes.Builder? SetLegacyStreamType(Android.Media.Stream streamType);
[<Android.Runtime.Register("setLegacyStreamType", "(I)Landroid/media/AudioAttributes$Builder;", "GetSetLegacyStreamType_IHandler")>]
abstract member SetLegacyStreamType : Android.Media.Stream -> Android.Media.AudioAttributes.Builder
override this.SetLegacyStreamType : Android.Media.Stream -> Android.Media.AudioAttributes.Builder
Parameters
- streamType
- Stream
one of AudioManager.STREAM_VOICE_CALL, AudioManager.STREAM_SYSTEM, AudioManager.STREAM_RING, AudioManager.STREAM_MUSIC, AudioManager.STREAM_ALARM, or AudioManager.STREAM_NOTIFICATION.
Returns
the same Builder instance.
- Attributes
Remarks
Sets attributes as inferred from the legacy stream types. Warning: do not use this method in combination with setting any other attributes such as usage, content type, flags or haptic control, as this method will overwrite (the more accurate) information describing the use case previously set in the Builder. In general, avoid using it and prefer setting usage and content type directly with setUsage(int) and setContentType(int). Use this method when building an AudioAttributes instance to initialize some of the attributes by information derived from a legacy stream type.
Android reference for android.media.AudioAttributes.Builder.setLegacyStreamType.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.