You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ builder.AddAudio();
23
23
```
24
24
25
25
> [!NOTE]
26
-
> You can also customize the shared settings for both audio [playback](./docs/audio-player.md#configure-the-playback-options) and [recording](./docs/audio-recorder.md#configure-the-recording-options).
26
+
> You can also customize the shared settings for audio [playback](./docs/audio-player.md#configure-the-playback-options), [recording](./docs/audio-recorder.md#configure-the-recording-options) and [streaming](./docs/audio-streamer.md#configure-streaming-options).
27
27
28
28
You can then enable your classes to depend on `IAudioManager` as per the following example.
29
29
@@ -37,7 +37,7 @@ public class AudioPlayerViewModel
Copy file name to clipboardExpand all lines: docs/audio-recorder.md
+28-19Lines changed: 28 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,6 @@
2
2
3
3
The `AudioRecorder` class provides you with the ability to record audio from a microphone in your .NET MAUI application to a file on disk. In order to create an `AudioRecorder` instance you can make use of the `CreateRecorder` method on the [`AudioManager`](../readme.md#audiomanager) class.
4
4
5
-
> [!NOTE]
6
-
> If you want to record in the background on iOS, you will need to add a key to the `Info.plist` file like show below.
7
-
> `<key>UIBackgroundModes</key>`
8
-
> `<array>`
9
-
> ` <string>audio</string>`
10
-
> `</array>`
11
-
12
5
```csharp
13
6
publicclassAudioRecorderViewModel
14
7
{
@@ -21,14 +14,14 @@ public class AudioRecorderViewModel
For a full example of this change check out our [*AndroidManifest.xml*](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/Android/AndroidManifest.xml) file.
98
+
For a full example of this change check out our [**AndroidManifest.xml**](../samples/Plugin.Maui.Audio.Sample/Platforms/Android/AndroidManifest.xml) file.
106
99
107
100
### iOS
108
101
109
-
The *Info.plist* file will need to be modified to include the following 2 entries inside the `dict` tag.
102
+
The **Info.plist** file will need to be modified to include the following 2 entries inside the `dict` tag.
110
103
111
104
```xml
112
105
<key>NSMicrophoneUsageDescription</key>
113
106
<string>The [app name] wants to use your microphone to record audio.</string>
114
107
```
115
108
109
+
> [!NOTE]
110
+
> If you want to record in the background on iOS, you will need to add a key to the **Info.plist** file like show below. \
111
+
> \
112
+
> `<key>UIBackgroundModes</key>`\
113
+
> `<array>`\
114
+
> ` <string>audio</string>`\
115
+
> `</array>`
116
+
116
117
**Replacing [app name] with your application name.**
117
118
118
-
For a full example of this change check out our [*Info.plist*](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/iOS/Info.plist) file.
119
+
For a full example of this change check out our [**Info.plist**](../samples/Plugin.Maui.Audio.Sample/Platforms/iOS/Info.plist) file.
119
120
120
121
### MacCatalyst
121
122
122
123
This change is identical to the iOS section but for explicitness:
123
124
124
-
The *Info.plist* file will need to be modified to include the following 2 entries inside the `dict` tag.
125
+
The **Info.plist** file will need to be modified to include the following 2 entries inside the `dict` tag.
125
126
126
127
```xml
127
128
<key>NSMicrophoneUsageDescription</key>
128
129
<string>The [app name] wants to use your microphone to record audio.</string>
129
130
```
130
131
132
+
> [!NOTE]
133
+
> If you distribute your app to others, you will need to declare an [entitlement](https://learn.microsoft.com/dotnet/maui/ios/entitlements) in order to be able to access the microphone. Add a key to the `Entitlements.plist` file like show below. \
> For a full example of this change check out our [**Entitlements.plist**](../samples/Plugin.Maui.Audio.Sample/Platforms/MacCatalyst/Entitlements.plist) file.
139
+
131
140
**Replacing [app name] with your application name.**
132
141
133
-
For a full example of this change check out our [*Info.plist*](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/MacCatalyst/Info.plist) file.
142
+
For a full example of this change check out our [**Info.plist**](../samples/Plugin.Maui.Audio.Sample/Platforms/MacCatalyst/Info.plist) file.
134
143
135
144
### Windows
136
145
137
-
The *Package.appxmanifest* file will need to be modified to include the following entry inside the `Capabilities` tag.
146
+
The **Package.appxmanifest** file will need to be modified to include the following entry inside the `Capabilities` tag.
138
147
139
148
```xml
140
149
<DeviceCapabilityName="microphone"/>
141
150
```
142
151
143
-
For a full example of this change check out our [*Package.appxmanifest*](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/Windows/Package.appxmanifest) file.
152
+
For a full example of this change check out our [**Package.appxmanifest**](../samples/Plugin.Maui.Audio.Sample/Platforms/Windows/Package.appxmanifest) file.
144
153
145
154
## Sample
146
155
147
-
For a concrete example of recording audio in a .NET MAUI application check out our sample application and specifically the [`AudioRecorderPageViewModel`](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/ViewModels/AudioRecorderPageViewModel.cs) class.
156
+
For a concrete example of recording audio in a .NET MAUI application check out our sample application and specifically the [`AudioRecorderPageViewModel`](../samples/Plugin.Maui.Audio.Sample/ViewModels/AudioRecorderPageViewModel.cs) class.
Copy file name to clipboardExpand all lines: docs/audio-streamer.md
+25-16Lines changed: 25 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,6 @@
2
2
3
3
The `AudioStreamer` class gives you the ability to stream audio from a microphone in your .NET MAUI application through an event handler. The `AudioStreamer` works pretty much the same as the recorder `AudioRecorder`, except that it provides raw audio data instead of a file. In order to create an `AudioStreamer` instance you can make use of the `CreateStreamer` method on the [`AudioManager`](../readme.md#audiomanager) class.
4
4
5
-
> [!NOTE]
6
-
> If you want to stream in the background on iOS, you will need to add a key to the `Info.plist` file like shown below.
7
-
> `<key>UIBackgroundModes</key>`
8
-
> `<array>`
9
-
> ` <string>audio</string>`
10
-
> `</array>`
11
-
12
5
```csharp
13
6
publicclassAudioStreamerViewModel
14
7
{
@@ -22,12 +15,12 @@ public class AudioStreamerViewModel
For a full example of this change check out our [*AndroidManifest.xml*](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/Android/AndroidManifest.xml) file.
120
+
For a full example of this change check out our [**AndroidManifest.xml**](../samples/Plugin.Maui.Audio.Sample/Platforms/Android/AndroidManifest.xml) file.
128
121
129
122
### iOS
130
123
131
-
The *Info.plist* file will need to be modified to include the following 2 entries inside the `dict` tag.
124
+
The **Info.plist** file will need to be modified to include the following 2 entries inside the `dict` tag.
132
125
133
126
```xml
134
127
<key>NSMicrophoneUsageDescription</key>
135
128
<string>The [app name] wants to use your microphone to record audio.</string>
136
129
```
137
130
131
+
> [!NOTE]
132
+
> If you want to stream in the background on iOS, you will need to add a key to the **Info.plist** file like shown below. \
133
+
> \
134
+
> `<key>UIBackgroundModes</key>`\
135
+
> `<array>`\
136
+
> ` <string>audio</string>`\
137
+
> `</array>`
138
+
138
139
**Replacing [app name] with your application name.**
139
140
140
-
For a full example of this change check out our [*Info.plist*](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/iOS/Info.plist) file.
141
+
For a full example of this change check out our [**Info.plist**](../samples/Plugin.Maui.Audio.Sample/Platforms/iOS/Info.plist) file.
141
142
142
143
### MacCatalyst
143
144
144
145
This change is identical to the iOS section but for explicitness:
145
146
146
-
The *Info.plist* file will need to be modified to include the following 2 entries inside the `dict` tag.
147
+
The **Info.plist** file will need to be modified to include the following 2 entries inside the `dict` tag.
147
148
148
149
```xml
149
150
<key>NSMicrophoneUsageDescription</key>
150
151
<string>The [app name] wants to use your microphone to record audio.</string>
151
152
```
152
153
154
+
> [!NOTE]
155
+
> If you distribute your app to others, you will need to declare an [entitlement](https://learn.microsoft.com/dotnet/maui/ios/entitlements) in order to be able to access the microphone. Add a key to the `Entitlements.plist` file like show below. \
> For a full example of this change check out our [**Entitlements.plist**](../samples/Plugin.Maui.Audio.Sample/Platforms/MacCatalyst/Entitlements.plist) file.
161
+
153
162
**Replacing [app name] with your application name.**
154
163
155
-
For a full example of this change check out our [*Info.plist*](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/MacCatalyst/Info.plist) file.
164
+
For a full example of this change check out our [**Info.plist**](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/MacCatalyst/Info.plist) file.
156
165
157
166
### Windows
158
167
159
-
The *Package.appxmanifest* file will need to be modified to include the following entry inside the `Capabilities` tag.
168
+
The **Package.appxmanifest** file will need to be modified to include the following entry inside the `Capabilities` tag.
160
169
161
170
```xml
162
171
<DeviceCapabilityName="microphone"/>
163
172
```
164
173
165
-
For a full example of this change check out our [*Package.appxmanifest*](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/Windows/Package.appxmanifest) file.
174
+
For a full example of this change check out our [**Package.appxmanifest**](https://github.com/jfversluis/Plugin.Maui.Audio/blob/main/samples/Plugin.Maui.Audio.Sample/Platforms/Windows/Package.appxmanifest) file.
0 commit comments