Repository navigation
Expand file tree
/
Copy pathAudio.xml
More file actions
531 lines (428 loc) · 26.4 KB
/
Copy pathAudio.xml
File metadata and controls
531 lines (428 loc) · 26.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
<Type Name="Audio" FullName="Microsoft.VisualBasic.Devices.Audio">
<TypeSignature Language="C#" Value="public class Audio" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi Audio extends System.Object" />
<TypeSignature Language="DocId" Value="T:Microsoft.VisualBasic.Devices.Audio" />
<TypeSignature Language="VB.NET" Value="Public Class Audio" />
<TypeSignature Language="C++ CLI" Value="public ref class Audio" />
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides methods for playing sounds.</summary>
<remarks>
<format type="text/markdown"><.
## Availability by Project Type
|Project type|Available|
|-|-|
|Windows Application|**Yes**|
|Class Library|**Yes**|
|Console Application|**Yes**|
|Windows Control Library|**Yes**|
|Web Control Library|No|
|Windows Service|**Yes**|
|Web Site|No|
## Examples
The `My.Computer.Audio.Play` method plays the specified sound in the background when `AudioPlayMode.Background` is specified.
[!code-vb[VbVbalrMyComputer#15](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class1.vb#15)]
This code can run only within a Windows Forms application.
The file name should reference a .wav sound file on your system.
To simplify the management of your sound files, consider storing the files as application resources. The files can then be accessed through the `My.Resources` object.
]]></format>
</remarks>
<altmember cref="T:Microsoft.VisualBasic.Devices.Computer" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Audio ();" />
<MemberSignature Language="ILAsm" Value=".method public specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.Devices.Audio.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 Audio();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:Microsoft.VisualBasic.Devices.Audio" /> class.</summary>
<remarks>
<format type="text/markdown"><
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Play">
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Plays a .wav sound file.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Play">
<MemberSignature Language="C#" Value="public void Play (string location);" />
<MemberSignature Language="ILAsm" Value=".method public instance void Play(string location) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.Devices.Audio.Play(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Play (location As String)" />
<MemberSignature Language="C++ CLI" Value="public:
 void Play(System::String ^ location);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="location" Type="System.String" />
</Parameters>
<Docs>
<param name="location">A <see langword="String" /> containing the name of the sound file</param>
<summary>Plays a .wav sound file.</summary>
<remarks>
<format type="text/markdown"><.
## Availability by Project Type
|Project type|Available|
|-|-|
|Windows Application|**Yes**|
|Class Library|**Yes**|
|Console Application|**Yes**|
|Windows Control Library|**Yes**|
|Web Control Library|No|
|Windows Service|**Yes**|
|Web Site|No|
## Examples
The `My.Computer.Audio.Play` method plays the specified sound in the background when `PlayMode.Background` is specified.
[!code-vb[VbVbalrMyComputer#15](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class1.vb#15)]
This code example can only run within a Windows Forms application.
The file name should reference a .wav sound file on your system.
To simplify the management of your sound files, consider storing the files as application resources. They can then be accessed through the `My.Resources` object.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="location" /> is an empty string.</exception>
<exception cref="T:System.IO.IOException">The user does not have sufficient permissions to access the file named by <paramref name="location" />.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The file path is malformed in <paramref name="location" />.</exception>
<exception cref="T:System.IO.PathTooLongException">The path name in <paramref name="location" /> is too long.</exception>
<exception cref="T:System.Security.SecurityException">A partial-trust situation exists in which the user lacks necessary permissions.</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">Controls the ability to access files and folders. Associated enumeration: <see cref="F:System.Security.Permissions.PermissionState.Unrestricted" />.</permission>
<permission cref="T:System.Security.Permissions.SecurityPermission">Describes a set of security permissions applied to code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.ControlThread" />.</permission>
<altmember cref="M:Microsoft.VisualBasic.Devices.Audio.Stop" />
<altmember cref="T:Microsoft.VisualBasic.AudioPlayMode" />
</Docs>
</Member>
<Member MemberName="Play">
<MemberSignature Language="C#" Value="public void Play (byte[] data, Microsoft.VisualBasic.AudioPlayMode playMode);" />
<MemberSignature Language="ILAsm" Value=".method public instance void Play(unsigned int8[] data, valuetype Microsoft.VisualBasic.AudioPlayMode playMode) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.Devices.Audio.Play(System.Byte[],Microsoft.VisualBasic.AudioPlayMode)" />
<MemberSignature Language="VB.NET" Value="Public Sub Play (data As Byte(), playMode As AudioPlayMode)" />
<MemberSignature Language="C++ CLI" Value="public:
 void Play(cli::array <System::Byte> ^ data, Microsoft::VisualBasic::AudioPlayMode playMode);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="data" Type="System.Byte[]" />
<Parameter Name="playMode" Type="Microsoft.VisualBasic.AudioPlayMode" />
</Parameters>
<Docs>
<param name="data">
<see langword="Byte" /> array that represents the sound file.</param>
<param name="playMode">
<see cref="T:Microsoft.VisualBasic.AudioPlayMode" /> mode for playing the sound. By default, <see langword="AudioPlayMode.Background" />.</param>
<summary>Plays a .wav sound file.</summary>
<remarks>
<format type="text/markdown"><.
## Availability by Project Type
|Project type|Available|
|-|-|
|Windows Application|**Yes**|
|Class Library|**Yes**|
|Console Application|**Yes**|
|Windows Control Library|**Yes**|
|Web Control Library|No|
|Windows Service|**Yes**|
|Web Site|No|
## Examples
The `My.Computer.Audio.Play` method plays the specified sound in the background when `PlayMode.Background` is specified.
[!code-vb[VbVbalrMyComputer#15](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class1.vb#15)]
This code example can only run within a Windows Forms application.
The file name should reference a .wav sound file on your system.
To simplify the management of your sound files, consider storing the files as application resources. They can then be accessed through the `My.Resources` object.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="data" /> is <see langword="Nothing" />.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="playMode" /> is not one of the <see cref="T:Microsoft.VisualBasic.AudioPlayMode" /> enumeration values.</exception>
<exception cref="T:System.Security.SecurityException">A partial-trust situation exists in which the user lacks necessary permissions.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">Describes a set of security permissions applied to code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.ControlThread" />.</permission>
<altmember cref="M:Microsoft.VisualBasic.Devices.Audio.Stop" />
<altmember cref="T:Microsoft.VisualBasic.AudioPlayMode" />
</Docs>
</Member>
<Member MemberName="Play">
<MemberSignature Language="C#" Value="public void Play (System.IO.Stream stream, Microsoft.VisualBasic.AudioPlayMode playMode);" />
<MemberSignature Language="ILAsm" Value=".method public instance void Play(class System.IO.Stream stream, valuetype Microsoft.VisualBasic.AudioPlayMode playMode) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.Devices.Audio.Play(System.IO.Stream,Microsoft.VisualBasic.AudioPlayMode)" />
<MemberSignature Language="C++ CLI" Value="public:
 void Play(System::IO::Stream ^ stream, Microsoft::VisualBasic::AudioPlayMode playMode);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="stream" Type="System.IO.Stream" />
<Parameter Name="playMode" Type="Microsoft.VisualBasic.AudioPlayMode" />
</Parameters>
<Docs>
<param name="stream">
<see cref="T:System.IO.Stream" /> that represents the sound file.</param>
<param name="playMode">
<see cref="T:Microsoft.VisualBasic.AudioPlayMode" /> mode for playing the sound. By default, <see langword="AudioPlayMode.Background" />.</param>
<summary>Plays a .wav sound file.</summary>
<remarks>
<format type="text/markdown"><.
## Availability by Project Type
|Project type|Available|
|-|-|
|Windows Application|**Yes**|
|Class Library|**Yes**|
|Console Application|**Yes**|
|Windows Control Library|**Yes**|
|Web Control Library|No|
|Windows Service|**Yes**|
|Web Site|No|
## Examples
The `My.Computer.Audio.Play` method plays the specified sound in the background when `PlayMode.Background` is specified.
[!code-vb[VbVbalrMyComputer#15](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class1.vb#15)]
This code example can only run within a Windows Forms application.
The file name should reference a .wav sound file on your system.
To simplify the management of your sound files, consider storing the files as application resources. They can then be accessed through the `My.Resources` object.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="stream" /> is <see langword="Nothing" />.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="playMode" /> is not one of the <see cref="T:Microsoft.VisualBasic.AudioPlayMode" /> enumeration values.</exception>
<exception cref="T:System.Security.SecurityException">A partial-trust situation exists in which the user lacks necessary permissions.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">Describes a set of security permissions applied to code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.ControlThread" />.</permission>
<altmember cref="M:Microsoft.VisualBasic.Devices.Audio.Stop" />
<altmember cref="T:Microsoft.VisualBasic.AudioPlayMode" />
<altmember cref="T:System.IO.Stream" />
</Docs>
</Member>
<Member MemberName="Play">
<MemberSignature Language="C#" Value="public void Play (string location, Microsoft.VisualBasic.AudioPlayMode playMode);" />
<MemberSignature Language="ILAsm" Value=".method public instance void Play(string location, valuetype Microsoft.VisualBasic.AudioPlayMode playMode) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.Devices.Audio.Play(System.String,Microsoft.VisualBasic.AudioPlayMode)" />
<MemberSignature Language="VB.NET" Value="Public Sub Play (location As String, playMode As AudioPlayMode)" />
<MemberSignature Language="C++ CLI" Value="public:
 void Play(System::String ^ location, Microsoft::VisualBasic::AudioPlayMode playMode);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="location" Type="System.String" />
<Parameter Name="playMode" Type="Microsoft.VisualBasic.AudioPlayMode" />
</Parameters>
<Docs>
<param name="location">A <see langword="String" /> containing the name of the sound file</param>
<param name="playMode">
<see cref="T:Microsoft.VisualBasic.AudioPlayMode" /> mode for playing the sound. By default, <see langword="AudioPlayMode.Background" />.</param>
<summary>Plays a .wav sound file.</summary>
<remarks>
<format type="text/markdown"><.
## Availability by Project Type
|Project type|Available|
|-|-|
|Windows Application|**Yes**|
|Class Library|**Yes**|
|Console Application|**Yes**|
|Windows Control Library|**Yes**|
|Web Control Library|No|
|Windows Service|**Yes**|
|Web Site|No|
## Examples
The `My.Computer.Audio.Play` method plays the specified sound in the background when `PlayMode.Background` is specified.
[!code-vb[VbVbalrMyComputer#15](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class1.vb#15)]
This code example can only run within a Windows Forms application.
The file name should reference a .wav sound file on your system.
To simplify the management of your sound files, consider storing the files as application resources. They can then be accessed through the `My.Resources` object.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="location" /> is an empty string.</exception>
<exception cref="T:System.IO.IOException">The user does not have sufficient permissions to access the file named by <paramref name="location" />.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The file path is malformed in <paramref name="location" />.</exception>
<exception cref="T:System.IO.PathTooLongException">The path name in <paramref name="location" /> is too long.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="playMode" /> is not one of the <see cref="T:Microsoft.VisualBasic.AudioPlayMode" /> enumeration values.</exception>
<exception cref="T:System.Security.SecurityException">A partial-trust situation exists in which the user lacks necessary permissions.</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">Controls the ability to access files and folders. Associated enumeration: <see cref="F:System.Security.Permissions.PermissionState.Unrestricted" />.</permission>
<permission cref="T:System.Security.Permissions.SecurityPermission">Describes a set of security permissions applied to code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.ControlThread" />.</permission>
<altmember cref="M:Microsoft.VisualBasic.Devices.Audio.Stop" />
<altmember cref="T:Microsoft.VisualBasic.AudioPlayMode" />
</Docs>
</Member>
<Member MemberName="PlaySystemSound">
<MemberSignature Language="C#" Value="public void PlaySystemSound (System.Media.SystemSound systemSound);" />
<MemberSignature Language="ILAsm" Value=".method public instance void PlaySystemSound(class System.Media.SystemSound systemSound) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.Devices.Audio.PlaySystemSound(System.Media.SystemSound)" />
<MemberSignature Language="C++ CLI" Value="public:
 void PlaySystemSound(System::Media::SystemSound ^ systemSound);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="systemSound" Type="System.Media.SystemSound" />
</Parameters>
<Docs>
<param name="systemSound">
<see cref="T:System.Media.SystemSound" /> object representing the system sound to play.</param>
<summary>Plays a system sound.</summary>
<remarks>
<format type="text/markdown"><.
## Availability by Project Type
|Project type|Available|
|-|-|
|Windows Application|**Yes**|
|Class Library|**Yes**|
|Console Application|**Yes**|
|Windows Control Library|**Yes**|
|Web Control Library|No|
|Windows Service|**Yes**|
|Web Site|No|
## Examples
This example uses the `My.Computer.Audio.PlaySystemSound` method to play a system sound.
[!code-vb[VbVbalrMyComputer#17](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class1.vb#17)]
This code example can run only within a Windows Forms application.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="systemSound" /> is <see langword="Nothing" />.</exception>
<altmember cref="T:System.Media.SystemSound" />
<altmember cref="T:System.Media.SystemSounds" />
</Docs>
</Member>
<Member MemberName="Stop">
<MemberSignature Language="C#" Value="public void Stop ();" />
<MemberSignature Language="ILAsm" Value=".method public instance void Stop() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.Devices.Audio.Stop" />
<MemberSignature Language="VB.NET" Value="Public Sub Stop ()" />
<MemberSignature Language="C++ CLI" Value="public:
 void Stop();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Stops a sound playing in the background.</summary>
<remarks>
<format type="text/markdown"><.
## Availability by Project Type
|Project type|Available|
|-|-|
|Windows Application|**Yes**|
|Class Library|**Yes**|
|Console Application|**Yes**|
|Windows Control Library|**Yes**|
|Web Control Library|No|
|Windows Service|**Yes**|
|Web Site|No|
## Examples
This example uses the `My.Computer.Audio.Stop` method to stop the application currently playing background or looping sound and uses the `My.Computer.Audio.Play` method to play a looping sound in the background.
[!code-vb[VbVbalrMyComputer#19](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class1.vb#19)]
This code example can run only within a Windows Forms application.
The file name should reference a .wav sound file on your system.
To simplify the management of your sound files, consider storing the files as application resources. These files can then be accessed through the `My.Resources` object.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>