13
13
<summary>Interface to to control the audio context of your application</summary>
14
<remarks>To be added.</remarks>
17
You use the various AudioSession methods to control how the
18
input and output are handled by the operating system,
19
configure the recorder and speakers, control where the audio
20
is played to, and where the audio is recorded from.
21
AudioSession also provides a mechanism to start and stop using
22
the audio system and to monitor changes to the audio system.
26
Both the initialization sequence and the use of some
27
properties on AudioSession can throw an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
31
Your application can use the <see cref="M:MonoMac.AudioToolbox.AudioSession.AddListener(MonoMac.AudioToolbox.AudioSessionProperty, MonoMac.AudioToolbox.AudioSession.PropertyListener)" />
32
method with the AudioInputAvailable value to monitor when the microphone becomes available.
36
<related type="sample" href="http://samples.xamarin.com/Samples/ByGuid?guid=26d904c2-c44a-46f2-883a-a01bb5657309">StreamingAudio</related>
37
<related type="sample" href="http://samples.xamarin.com/Samples/ByGuid?guid=133bdad4-776a-454d-a265-889d009d0335">SysSound</related>
17
40
<Member MemberName="AddListener">
29
52
<Parameter Name="listener" Type="MonoMac.AudioToolbox.AudioSession+PropertyListener" />
32
<param name="property">To be added.</param>
33
<param name="listener">To be added.</param>
34
<summary>To be added.</summary>
35
<remarks>To be added.</remarks>
55
<param name="property">The property to monitor.</param>
56
<param name="listener">Callback to invoke when the property changes.</param>
57
<summary>Registers a method to be invoked when an audio session property changes.</summary>
58
<remarks>Use the RemoveListener method to stop receiving property change notifications.</remarks>
38
61
<Member MemberName="AudioInputAvailable">
46
69
<ReturnType>System.Boolean</ReturnType>
49
<summary>To be added.</summary>
50
<value>To be added.</value>
51
<remarks>To be added.</remarks>
72
<summary>Determines whether audio input is available.</summary>
78
This property determines whether input is available.
79
Phones always have input available, while iPod Touch
80
devices only have input available if a microphone or a
81
headset with a microphone is plugged.
85
If there is an error reading or setting the property,
86
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
54
91
<Member MemberName="AudioRoute">
59
96
<AssemblyVersion>0.0.0.0</AssemblyVersion>
100
<AttributeName>System.Obsolete("Use InputRoute or OutputRoute instead")</AttributeName>
62
104
<ReturnType>System.String</ReturnType>
65
<summary>To be added.</summary>
66
<value>To be added.</value>
67
<remarks>To be added.</remarks>
107
<summary>Obsolete method.</summary>
112
If there is an error reading or setting the property,
113
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
70
118
<Member MemberName="AudioShouldDuck">
78
126
<ReturnType>System.Boolean</ReturnType>
81
<summary>To be added.</summary>
82
<value>To be added.</value>
83
<remarks>To be added.</remarks>
129
<summary>Controls audio ducking for your application.</summary>
134
When this property is set to true, if there is background
135
music playing and you have configured this session to
136
allow audio mixing, when your application produces sound,
137
the background music volume is reduced. After you play
138
your sound, you should reset the value to false.
141
By default, this property is set to false, and no audio ducking takes place.
144
If there is an error reading or setting the property,
145
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
86
150
<Member MemberName="Category">
94
158
<ReturnType>MonoMac.AudioToolbox.AudioSessionCategory</ReturnType>
97
<summary>To be added.</summary>
98
<value>To be added.</value>
99
<remarks>To be added.</remarks>
161
<summary>Controls how the operating system treats the audio from your application.</summary>
167
This property is used to control how the operating system
168
treat your audio. It can be used to control whether your
169
application needs exclusive access to the microphones or
170
speakers or to configure if the audio can be mixed with
175
If there is an error reading or setting the property,
176
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
102
181
<Member MemberName="CurrentHardwareInputLatency">
110
189
<ReturnType>System.Single</ReturnType>
113
<summary>To be added.</summary>
114
<value>To be added.</value>
115
<remarks>To be added.</remarks>
192
<summary>The current hardware input latency in seconds.</summary>
197
If there is an error reading or setting the property,
198
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
118
203
<Member MemberName="CurrentHardwareInputNumberChannels">
126
211
<ReturnType>System.Int32</ReturnType>
129
<summary>To be added.</summary>
130
<value>To be added.</value>
131
<remarks>To be added.</remarks>
214
<summary>The number of hardware input channels.</summary>
219
If there is an error reading or setting the property,
220
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
134
225
<Member MemberName="CurrentHardwareIOBufferDuration">
142
233
<ReturnType>System.Single</ReturnType>
145
<summary>To be added.</summary>
146
<value>To be added.</value>
147
<remarks>To be added.</remarks>
236
<summary>The size in seconds of the hardware input and output buffer.</summary>
241
If there is an error reading or setting the property,
242
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
150
247
<Member MemberName="CurrentHardwareOutputLatency">
158
255
<ReturnType>System.Single</ReturnType>
161
<summary>To be added.</summary>
162
<value>To be added.</value>
163
<remarks>To be added.</remarks>
258
<summary>The current hardware output latency in seconds.</summary>
263
If there is an error reading or setting the property,
264
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
166
269
<Member MemberName="CurrentHardwareOutputNumberChannels">
174
277
<ReturnType>System.Int32</ReturnType>
177
<summary>To be added.</summary>
178
<value>To be added.</value>
179
<remarks>To be added.</remarks>
280
<summary>Number of hardware output channels.</summary>
285
If there is an error reading or setting the property,
286
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
182
291
<Member MemberName="CurrentHardwareOutputVolume">
190
299
<ReturnType>System.Single</ReturnType>
193
<summary>To be added.</summary>
194
<value>To be added.</value>
195
<remarks>To be added.</remarks>
302
<summary>Your application volume, from 0 to 1.</summary>
303
<value>Floating point value between 0 and 1.</value>
306
If there is an error reading or setting the property,
307
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
198
312
<Member MemberName="CurrentHardwareSampleRate">
206
320
<ReturnType>System.Double</ReturnType>
209
<summary>To be added.</summary>
210
<value>To be added.</value>
211
<remarks>To be added.</remarks>
323
<summary>The current hardware sample rate.</summary>
328
If there is an error reading or setting the property,
329
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
214
334
<Member MemberName="Initialize">
226
<summary>To be added.</summary>
227
<remarks>To be added.</remarks>
346
<summary>Initializes the Audio Session.</summary>
350
In addition to calling the Initialize method on
351
AudioSession, you will want to set the <see cref="P:MonoMac.AudioToolbox.AudioSession.Category" />
352
and the <see cref="P:MonoMac.AudioToolbox.AudioSession.Mode" />
353
properties to control the priority of your audio and the
354
rules for mixing your audio with other audio playing on
360
When you call this variation of Initialize, both the <see cref="E:MonoMac.AudioToolbox.AudioSession.Interrupted" />
361
and <see cref="E:MonoMac.AudioToolbox.AudioSession.Resumed" />
362
events are raised on the main loop. Use the <see cref="P:MonoMac.AudioToolbox.AudioSession.Initialize(MonoMac.CoreFoundation.CFRunLoop
 runLoop, System.String runMode)" /> if you want to specify
367
If there is an error initializing the AudioSession, this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
372
// Initialize the audio session for audio playback
374
AudioSession.Initialize ();
375
AudioSession.Category = AudioSessionCategory.MediaPlayback;
230
381
<Member MemberName="Initialize">
242
393
<Parameter Name="runMode" Type="System.String" />
245
<param name="runLoop">To be added.</param>
246
<param name="runMode">To be added.</param>
247
<summary>To be added.</summary>
396
<param name="runLoop">The runloop to execute on.</param>
397
<param name="runMode">Run loop mode (see NSRunLoop for the various modes).</param>
398
<summary>Initializes the Audio Session.</summary>
402
In addition to calling the Initialize method on
403
AudioSession, you will want to set the <see cref="P:MonoMac.AudioToolbox.AudioSession.Category" />
404
and the <see cref="P:MonoMac.AudioToolbox.AudioSession.Mode" />
405
properties to control the priority of your audio and the
406
rules for mixing your audio with other audio playing on
412
When you call this variation of Initialize, both the <see cref="E:MonoMac.AudioToolbox.AudioSession.Interrupted" />
413
and <see cref="E:MonoMac.AudioToolbox.AudioSession.Resumed" />
414
events are raised on the specified run loop with the
415
specified run loop mode. Use the <see cref="P:MonoMac.AudioToolbox.AudioSession.Initialize()" />
416
if you want those events to be raised on the main thread.
422
// Initialize the audio session for audio playback
424
AudioSession.Initialize (myRunLoop, myRunMode);
425
AudioSession.Category = AudioSessionCategory.MediaPlayback;
431
<Member MemberName="InputGainAvailable">
432
<MemberSignature Language="C#" Value="public static bool InputGainAvailable { get; }" />
433
<MemberSignature Language="ILAsm" Value=".property bool InputGainAvailable" />
434
<MemberType>Property</MemberType>
436
<AssemblyVersion>0.0.0.0</AssemblyVersion>
440
<AttributeName>MonoMac.ObjCRuntime.Since(5, 0)</AttributeName>
444
<ReturnType>System.Boolean</ReturnType>
447
<summary>To be added.</summary>
448
<value>To be added.</value>
449
<remarks>To be added.</remarks>
452
<Member MemberName="InputGainScalar">
453
<MemberSignature Language="C#" Value="public static float InputGainScalar { get; set; }" />
454
<MemberSignature Language="ILAsm" Value=".property float32 InputGainScalar" />
455
<MemberType>Property</MemberType>
457
<AssemblyVersion>0.0.0.0</AssemblyVersion>
461
<AttributeName>MonoMac.ObjCRuntime.Since(5, 0)</AttributeName>
465
<ReturnType>System.Single</ReturnType>
468
<summary>To be added.</summary>
469
<value>To be added.</value>
248
470
<remarks>To be added.</remarks>
256
478
<AssemblyVersion>0.0.0.0</AssemblyVersion>
482
<AttributeName>MonoMac.ObjCRuntime.Since(5, 0)</AttributeName>
259
486
<ReturnType>MonoMac.AudioToolbox.AudioSessionInputRouteKind</ReturnType>
489
<summary>Controls the source for audio input.</summary>
496
<Member MemberName="InputSources">
497
<MemberSignature Language="C#" Value="public static MonoMac.AudioToolbox.AccessoryInfo[] InputSources { get; }" />
498
<MemberSignature Language="ILAsm" Value=".property class MonoMac.AudioToolbox.AccessoryInfo[] InputSources" />
499
<MemberType>Property</MemberType>
501
<AssemblyVersion>0.0.0.0</AssemblyVersion>
505
<AttributeName>MonoMac.ObjCRuntime.Since(5, 0)</AttributeName>
509
<ReturnType>MonoMac.AudioToolbox.AccessoryInfo[]</ReturnType>
262
512
<summary>To be added.</summary>
263
513
<value>To be added.</value>
264
514
<remarks>To be added.</remarks>
275
525
<ReturnType>System.EventHandler</ReturnType>
278
<summary>To be added.</summary>
279
<remarks>To be added.</remarks>
528
<summary>Event raised when the audio session has been interrupted.</summary>
532
You can use the <see cref="P:MonoMac.AudioToolbox.AudioSession.InterruptionType" /> property to determine the cause of the interruption.
536
In addition, the Resumed event is raised when the audio session is resumed.
282
541
<Member MemberName="InterruptionType">
295
554
<ReturnType>MonoMac.AudioToolbox.AudioSessionInterruptionType</ReturnType>
298
<summary>To be added.</summary>
299
<value>To be added.</value>
300
<remarks>To be added.</remarks>
557
<summary>The type of interruption, used to determine the appropriate course of action when the AudioSession is interrupted.</summary>
561
The value of this property is only valid when called from the <see cref="E:MonoMac.AudioToolbox.AudioSession.Interrupted" /> event handler.
303
565
<Member MemberName="Mode">
341
608
<ReturnType>System.Boolean</ReturnType>
611
<summary>Whether another application is currently playing back audio.</summary>
618
<Member MemberName="OutputDestinations">
619
<MemberSignature Language="C#" Value="public static MonoMac.AudioToolbox.AccessoryInfo[] OutputDestinations { get; }" />
620
<MemberSignature Language="ILAsm" Value=".property class MonoMac.AudioToolbox.AccessoryInfo[] OutputDestinations" />
621
<MemberType>Property</MemberType>
623
<AssemblyVersion>0.0.0.0</AssemblyVersion>
627
<AttributeName>MonoMac.ObjCRuntime.Since(5, 0)</AttributeName>
631
<ReturnType>MonoMac.AudioToolbox.AccessoryInfo[]</ReturnType>
344
634
<summary>To be added.</summary>
345
635
<value>To be added.</value>
346
636
<remarks>To be added.</remarks>
354
644
<AssemblyVersion>0.0.0.0</AssemblyVersion>
648
<AttributeName>MonoMac.ObjCRuntime.Since(5, 0)</AttributeName>
357
652
<ReturnType>MonoMac.AudioToolbox.AudioSessionOutputRouteKind[]</ReturnType>
360
<summary>To be added.</summary>
361
<value>To be added.</value>
362
<remarks>To be added.</remarks>
655
<summary>Retrives information about the available audio output routes.</summary>
660
If there is an error reading or setting the property,
661
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
365
666
<Member MemberName="OverrideCategoryDefaultToSpeaker">
376
677
<summary>To be added.</summary>
377
678
<value>To be added.</value>
378
<remarks>To be added.</remarks>
681
If there is an error reading or setting the property,
682
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
381
687
<Member MemberName="OverrideCategoryEnableBluetoothInput">
392
698
<summary>If input is coming from a bluetooth headset, it routes the audio output to the headset.</summary>
393
<value>To be added.</value>
394
<remarks>To be added.</remarks>
703
If there is an error reading or setting the property,
704
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
397
709
<Member MemberName="OverrideCategoryMixWithOthers">
405
717
<ReturnType>System.Boolean</ReturnType>
408
<summary>To be added.</summary>
409
<value>To be added.</value>
410
<remarks>To be added.</remarks>
720
<summary>Mixes the background audio with the audio generated by the application, regardless of the default <see cref="P:MonoMac.AudioToolbox.AudioSession.Category" /> setting.</summary>
725
This setting can be used when the <see cref="P:MonoMac.AudioToolbox.AudioSession.Category" /> session is set to either MediaPlayback or PlayAndRecord.
728
If there is an error reading or setting the property,
729
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
413
734
<Member MemberName="PreferredHardwareIOBufferDuration">
421
742
<ReturnType>System.Single</ReturnType>
424
<summary>To be added.</summary>
425
<value>To be added.</value>
426
<remarks>To be added.</remarks>
745
<summary>Your application desired buffer size in seconds. </summary>
750
There is no guarantee that you will get the number of requested seconds, you can determine the actual number of seconds by reading the <see cref="P:MonoMac.AudioToolbox.AudioSession.CurrentHardwareIOBufferDuration" /> property.
753
If there is an error reading or setting the property,
754
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
429
759
<Member MemberName="PreferredHardwareSampleRate">
437
767
<ReturnType>System.Double</ReturnType>
440
<summary>To be added.</summary>
441
<value>To be added.</value>
442
<remarks>To be added.</remarks>
770
<summary>Your desired audio sample rate.</summary>
775
There is no guarantee that you will get the requested sample rate, you can determine the actual number by reading the <see cref="P:MonoMac.AudioToolbox.AudioSession.CurrentHardwareSampleRate" /> property.
778
If there is an error reading or setting the property,
779
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
445
784
<Member MemberName="RemoveListener">
457
796
<Parameter Name="listener" Type="MonoMac.AudioToolbox.AudioSession+PropertyListener" />
460
<param name="property">To be added.</param>
461
<param name="listener">To be added.</param>
462
<summary>To be added.</summary>
463
<remarks>To be added.</remarks>
799
<param name="property">The monitored property.</param>
800
<param name="listener">The Callback that was specified in the call to AddListener.</param>
801
<summary>Removes the specified listener from the list of monitored audio session properties.</summary>
802
<remarks>Properties to monitor are registered with the AddListener method.</remarks>
466
805
<Member MemberName="Resumed">
474
813
<ReturnType>System.EventHandler</ReturnType>
477
<summary>To be added.</summary>
478
<remarks>To be added.</remarks>
816
<summary>Event raised when the audio session has resumed.</summary>
817
<remarks>In addition, the Interrupted event is raised when the audio session is interrupted.</remarks>
481
820
<Member MemberName="RoutingOverride">
489
828
<ReturnType>MonoMac.AudioToolbox.AudioSessionRoutingOverride</ReturnType>
492
<summary>To be added.</summary>
493
<value>To be added.</value>
494
<remarks>To be added.</remarks>
831
<summary>Controls the output route, overriding the default set by the <see cref="P:MonoMac.AudioToolbox.AudioSession.Category" />.</summary>
836
This property is only valid if the Category is set to PlayAndRecord.
839
If this property is set to Speaker when a headset is
840
plugged, this will also switch the input to use the system
841
microphone, and not the one on the headset.
844
The setting of this variable is reset when a headset are plugged or unplugged.
847
If there is an error reading or setting the property,
848
this will raise an <see cref="T:MonoMac.AudioToolbox.AudioSessionException" />.
497
853
<Member MemberName="SetActive">
508
864
<Parameter Name="active" Type="System.Boolean" />
867
<param name="active">Whether to enable the audio session.</param>
868
<summary>Enables or Disables the audio session.</summary>
871
This method is used to enable and disable the audio session.
874
This method can throw an AudioSessionException if another
875
application is currently using the AudioSession in the
876
foreground and does not support audio mixing.
881
<Member MemberName="SetActive">
882
<MemberSignature Language="C#" Value="public static MonoMac.AudioToolbox.AudioSessionErrors SetActive (bool active, MonoMac.AudioToolbox.AudioSessionActiveFlags flags);" />
883
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype MonoMac.AudioToolbox.AudioSessionErrors SetActive(bool active, valuetype MonoMac.AudioToolbox.AudioSessionActiveFlags flags) cil managed" />
884
<MemberType>Method</MemberType>
886
<AssemblyVersion>0.0.0.0</AssemblyVersion>
890
<AttributeName>MonoMac.ObjCRuntime.Since(4, 0)</AttributeName>
894
<ReturnType>MonoMac.AudioToolbox.AudioSessionErrors</ReturnType>
897
<Parameter Name="active" Type="System.Boolean" />
898
<Parameter Name="flags" Type="MonoMac.AudioToolbox.AudioSessionActiveFlags" />
511
901
<param name="active">To be added.</param>
902
<param name="flags">To be added.</param>
512
903
<summary>To be added.</summary>
904
<returns>To be added.</returns>
513
905
<remarks>To be added.</remarks>