├── logo
├── icon.png
├── icon-nuget.png
├── verticalversion.png
├── horizontalversion.png
└── audiorecorder-github-logo.png
├── Samples
├── Native
│ ├── AudioRecord.UWP
│ │ ├── Assets
│ │ │ ├── StoreLogo.png
│ │ │ ├── SplashScreen.scale-200.png
│ │ │ ├── LockScreenLogo.scale-200.png
│ │ │ ├── Square44x44Logo.scale-200.png
│ │ │ ├── Wide310x150Logo.scale-200.png
│ │ │ ├── Square150x150Logo.scale-200.png
│ │ │ └── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ ├── App.xaml
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── Default.rd.xml
│ │ ├── MainPage.xaml
│ │ ├── Package.appxmanifest
│ │ ├── MainPage.xaml.cs
│ │ └── App.xaml.cs
│ ├── AudioRecord.Android
│ │ ├── Resources
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── values
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── Strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── layout
│ │ │ │ └── activity_main.axml
│ │ │ └── AboutResources.txt
│ │ ├── Assets
│ │ │ └── AboutAssets.txt
│ │ ├── Properties
│ │ │ ├── AndroidManifest.xml
│ │ │ └── AssemblyInfo.cs
│ │ ├── MainActivity.cs
│ │ └── AudioRecord.Android.csproj
│ └── AudioRecord.iOS
│ │ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Icon120.png
│ │ │ ├── Icon152.png
│ │ │ ├── Icon167.png
│ │ │ ├── Icon180.png
│ │ │ ├── Icon20.png
│ │ │ ├── Icon29.png
│ │ │ ├── Icon40.png
│ │ │ ├── Icon58.png
│ │ │ ├── Icon60.png
│ │ │ ├── Icon76.png
│ │ │ ├── Icon80.png
│ │ │ ├── Icon87.png
│ │ │ ├── Icon1024.png
│ │ │ └── Contents.json
│ │ ├── Entitlements.plist
│ │ ├── Main.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── LaunchScreen.storyboard
│ │ ├── Info.plist
│ │ ├── ViewController.designer.cs
│ │ ├── AppDelegate.cs
│ │ ├── ViewController.cs
│ │ ├── Resources
│ │ └── LaunchScreen.xib
│ │ ├── Main.storyboard
│ │ └── AudioRecord.iOS.csproj
└── Forms
│ ├── AudioRecord.Forms.iOS
│ ├── Resources
│ │ ├── Default.png
│ │ ├── Default@2x.png
│ │ ├── Default-568h@2x.png
│ │ ├── Default-Portrait.png
│ │ ├── Default-Portrait@2x.png
│ │ └── LaunchScreen.storyboard
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Icon120.png
│ │ │ ├── Icon152.png
│ │ │ ├── Icon167.png
│ │ │ ├── Icon180.png
│ │ │ ├── Icon20.png
│ │ │ ├── Icon29.png
│ │ │ ├── Icon40.png
│ │ │ ├── Icon58.png
│ │ │ ├── Icon60.png
│ │ │ ├── Icon76.png
│ │ │ ├── Icon80.png
│ │ │ ├── Icon87.png
│ │ │ ├── Icon1024.png
│ │ │ └── Contents.json
│ ├── Entitlements.plist
│ ├── Main.cs
│ ├── Info.plist
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── AppDelegate.cs
│ ├── AudioRecord.Forms.UWP
│ ├── Assets
│ │ ├── StoreLogo.backup.png
│ │ ├── LargeTile.scale-100.png
│ │ ├── LargeTile.scale-200.png
│ │ ├── LargeTile.scale-400.png
│ │ ├── SmallTile.scale-100.png
│ │ ├── SmallTile.scale-200.png
│ │ ├── SmallTile.scale-400.png
│ │ ├── StoreLogo.scale-100.png
│ │ ├── StoreLogo.scale-200.png
│ │ ├── StoreLogo.scale-400.png
│ │ ├── SplashScreen.scale-100.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── SplashScreen.scale-400.png
│ │ ├── Square44x44Logo.scale-100.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-400.png
│ │ ├── Wide310x150Logo.scale-100.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-400.png
│ │ ├── Square150x150Logo.scale-100.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-400.png
│ │ ├── Square44x44Logo.targetsize-16.png
│ │ ├── Square44x44Logo.targetsize-256.png
│ │ ├── Square44x44Logo.targetsize-48.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png
│ │ └── Square44x44Logo.altform-unplated_targetsize-48.png
│ ├── App.xaml
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ ├── Package.appxmanifest
│ └── App.xaml.cs
│ ├── AudioRecord.Forms.Android
│ ├── Resources
│ │ ├── mipmap-hdpi
│ │ │ ├── Icon.png
│ │ │ └── launcher_foreground.png
│ │ ├── mipmap-mdpi
│ │ │ ├── icon.png
│ │ │ └── launcher_foreground.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── Icon.png
│ │ │ └── launcher_foreground.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── Icon.png
│ │ │ └── launcher_foreground.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── Icon.png
│ │ │ └── launcher_foreground.png
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── icon.xml
│ │ │ └── icon_round.xml
│ │ ├── values
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ ├── layout
│ │ │ ├── Toolbar.axml
│ │ │ └── Tabbar.axml
│ │ └── AboutResources.txt
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── MainActivity.cs
│ └── AudioRecord.Forms.Android.csproj
│ └── AudioRecord.Forms
│ ├── App.xaml
│ ├── AudioRecord.Forms.csproj
│ ├── App.xaml.cs
│ ├── MainPage.xaml
│ └── MainPage.xaml.cs
├── Plugin.AudioRecorder.Shared
├── AudioPlayer.cs
├── AudioStreamDetails.cs
├── Plugin.AudioRecorder.Shared.shproj
├── Plugin.AudioRecorder.Shared.projitems
├── IAudioStream.cs
├── WaveRecorder.cs
└── AudioFunctions.cs
├── .editorconfig
├── Plugin.AudioRecorder.iOS
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
├── Plugin.AudioRecorder.iOS.csproj
├── AudioRecorderService.cs
├── AudioPlayer.cs
└── AudioStream.cs
├── Plugin.AudioRecorder.Android
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
├── AudioPlayer.cs
├── AudioRecorderService.cs
├── Plugin.AudioRecorder.Android.csproj
└── AudioStream.cs
├── Plugin.AudioRecorder
├── AudioPlayer.cs
├── Plugin.AudioRecorder.csproj
├── AudioRecorderService.cs
└── AudioStream.cs
├── Plugin.AudioRecorder.UWP
├── AudioRecorderService.cs
├── Properties
│ ├── AssemblyInfo.cs
│ └── Plugin.AudioRecorder.UWP.rd.xml
├── AudioPlayer.cs
└── Plugin.AudioRecorder.UWP.csproj
├── LICENSE
├── Plugin.AudioRecorder.NuGet
└── Plugin.AudioRecorder.NuGet.nuproj
└── .gitignore
/logo/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/logo/icon.png
--------------------------------------------------------------------------------
/logo/icon-nuget.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/logo/icon-nuget.png
--------------------------------------------------------------------------------
/logo/verticalversion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/logo/verticalversion.png
--------------------------------------------------------------------------------
/logo/horizontalversion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/logo/horizontalversion.png
--------------------------------------------------------------------------------
/logo/audiorecorder-github-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/logo/audiorecorder-github-logo.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.UWP/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/StoreLogo.backup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/StoreLogo.backup.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.UWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/LargeTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/LargeTile.scale-100.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/LargeTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/LargeTile.scale-200.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/LargeTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/LargeTile.scale-400.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/SmallTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/SmallTile.scale-100.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/SmallTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/SmallTile.scale-200.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/SmallTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/SmallTile.scale-400.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/StoreLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/StoreLogo.scale-400.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.UWP/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.UWP/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.UWP/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-hdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-hdpi/Icon.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.UWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Shared/AudioPlayer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Plugin.AudioRecorder
4 | {
5 | public partial class AudioPlayer
6 | {
7 | public event EventHandler FinishedPlaying;
8 | }
9 | }
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xhdpi/Icon.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xxhdpi/Icon.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Wide310x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Wide310x150Logo.scale-400.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2C3E50
4 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xxxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xxxhdpi/Icon.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square150x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square150x150Logo.scale-400.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AudioRecord.Android
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig: http://EditorConfig.org
2 | root = true
3 |
4 | [*]
5 | end_of_line = crlf
6 | insert_final_newline = true
7 | charset = utf-8
8 |
9 | [*.cs]
10 | indent_style = tab
11 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.targetsize-16.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.targetsize-256.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.iOS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-hdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-hdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-mdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-mdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Android/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.Android/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Native/AudioRecord.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/HEAD/Samples/Forms/AudioRecord.Forms.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2c3e50
4 | #1B3147
5 | #3498db
6 |
7 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
8 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/mipmap-anydpi-v26/icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder/AudioPlayer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Plugin.AudioRecorder
4 | {
5 | public partial class AudioPlayer
6 | {
7 | public void Play (string pathToAudioFile) => throw new NotImplementedException ();
8 |
9 | public void Pause () => throw new NotImplementedException ();
10 |
11 | public void Play () => throw new NotImplementedException ();
12 | }
13 | }
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms/AudioRecord.Forms.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace AudioRecord.iOS
4 | {
5 | public class Application
6 | {
7 | // This is the main entry point of the application.
8 | static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, "AppDelegate");
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/Plugin.AudioRecorder/Plugin.AudioRecorder.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder/AudioRecorderService.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Threading.Tasks;
3 |
4 | namespace Plugin.AudioRecorder
5 | {
6 | public partial class AudioRecorderService
7 | {
8 | Task GetDefaultFilePath ()
9 | {
10 | return Task.FromResult (Path.Combine (Path.GetTempPath (), DefaultFileName));
11 | }
12 |
13 | void OnRecordingStarting ()
14 | {
15 | }
16 |
17 | void OnRecordingStopped ()
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace AudioRecord.Forms.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main(string[] args)
14 | {
15 | // if you want to use a different Application Delegate class from "AppDelegate"
16 | // you can specify it here.
17 | UIApplication.Main(args, null, "AppDelegate");
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.UWP/AudioRecorderService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Windows.Storage;
4 |
5 | namespace Plugin.AudioRecorder
6 | {
7 | public partial class AudioRecorderService
8 | {
9 | partial void Init () { }
10 |
11 | async Task GetDefaultFilePath ()
12 | {
13 | var temporaryFolder = ApplicationData.Current.TemporaryFolder;
14 | var tempFile = await temporaryFolder.CreateFileAsync (DefaultFileName, CreationCollisionOption.ReplaceExisting);
15 |
16 | return tempFile.Path;
17 | }
18 |
19 | void OnRecordingStarting ()
20 | {
21 | }
22 |
23 | void OnRecordingStopped ()
24 | {
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Xaml;
4 |
5 | [assembly: XamlCompilation (XamlCompilationOptions.Compile)]
6 | namespace AudioRecord.Forms
7 | {
8 | public partial class App : Application
9 | {
10 | public App ()
11 | {
12 | InitializeComponent();
13 |
14 | MainPage = new MainPage();
15 | }
16 |
17 | protected override void OnStart ()
18 | {
19 | // Handle when your app starts
20 | }
21 |
22 | protected override void OnSleep ()
23 | {
24 | // Handle when your app sleeps
25 | }
26 |
27 | protected override void OnResume ()
28 | {
29 | // Handle when your app resumes
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Shared/AudioStreamDetails.cs:
--------------------------------------------------------------------------------
1 | namespace Plugin.AudioRecorder
2 | {
3 | ///
4 | /// Represents the details of an , including channel count, sample rate, and bits per sample.
5 | ///
6 | public class AudioStreamDetails
7 | {
8 | ///
9 | /// Gets the sample rate of the underlying audio stream.
10 | ///
11 | public int SampleRate { get; set; }
12 |
13 | ///
14 | /// Gets the channel count of the underlying audio stream.
15 | ///
16 | public int ChannelCount { get; set; }
17 |
18 | ///
19 | /// Gets the bits per sample of the underlying audio stream.
20 | ///
21 | public int BitsPerSample { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | namespace AudioRecord.Forms.UWP
17 | {
18 | public sealed partial class MainPage
19 | {
20 | public MainPage()
21 | {
22 | this.InitializeComponent();
23 |
24 | LoadApplication(new AudioRecord.Forms.App());
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Shared/Plugin.AudioRecorder.Shared.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {8EA2B3CD-E80A-420F-B7FC-6F36583C7FD5}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/layout/activity_main.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
12 |
18 |
24 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Shared/Plugin.AudioRecorder.Shared.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | {8EA2B3CD-E80A-420F-B7FC-6F36583C7FD5}
7 |
8 |
9 | Plugin.AudioRecorder
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder/AudioStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Plugin.AudioRecorder
5 | {
6 | // Dummy implementation - Bait & Switch will be used to force apps to use platform specific dlls.
7 | internal class AudioStream : IAudioStream
8 | {
9 | public int SampleRate => throw new NotImplementedException ();
10 |
11 | public int ChannelCount => throw new NotImplementedException ();
12 |
13 | public int BitsPerSample => throw new NotImplementedException ();
14 |
15 | public bool Active => throw new NotImplementedException ();
16 |
17 | public event EventHandler OnBroadcast;
18 | public event EventHandler OnActiveChanged;
19 | public event EventHandler OnException;
20 |
21 | public AudioStream (int sampleRate)
22 | {
23 | }
24 |
25 | public Task Start ()
26 | {
27 | throw new NotImplementedException ();
28 | }
29 |
30 | public Task Stop ()
31 | {
32 | throw new NotImplementedException ();
33 | }
34 |
35 | public void Flush ()
36 | {
37 | throw new NotImplementedException ();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Nate Rickard
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle("Plugin.AudioRecorder.iOS")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("")]
12 | [assembly: AssemblyCopyright("${AuthorCopyright}")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion("1.0.0.0")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle("Plugin.AudioRecorder.Android")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("")]
12 | [assembly: AssemblyCopyright("${AuthorCopyright}")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion("1.0.0.0")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android;
2 | using Android.App;
3 | using Android.Content.PM;
4 | using Android.OS;
5 | using Android.Support.V4.App;
6 | using Android.Support.V4.Content;
7 | using System;
8 |
9 | namespace AudioRecord.Forms.Droid
10 | {
11 | [Activity(Label = "AudioRecord.Forms", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
12 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
13 | {
14 | protected override void OnCreate(Bundle bundle)
15 | {
16 | TabLayoutResource = Resource.Layout.Tabbar;
17 | ToolbarResource = Resource.Layout.Toolbar;
18 |
19 | base.OnCreate(bundle);
20 |
21 | global::Xamarin.Forms.Forms.Init(this, bundle);
22 | LoadApplication(new App());
23 |
24 | if (ContextCompat.CheckSelfPermission (this, Manifest.Permission.RecordAudio) != Permission.Granted)
25 | {
26 | ActivityCompat.RequestPermissions (this, new String []{ Manifest.Permission.RecordAudio }, 1);
27 | }
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("AudioRecord.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("AudioRecord.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Plugin.AudioRecorder.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Plugin.AudioRecorder.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("AudioRecord.Forms.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("AudioRecord.Forms.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("AudioRecord.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("AudioRecord.Android")]
14 | [assembly: AssemblyCopyright("Copyright © 2018")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Android/AudioPlayer.cs:
--------------------------------------------------------------------------------
1 | using Android.Media;
2 | using System;
3 |
4 | namespace Plugin.AudioRecorder
5 | {
6 | public partial class AudioPlayer
7 | {
8 | private MediaPlayer mediaPlayer;
9 |
10 | public AudioPlayer ()
11 | {
12 | }
13 |
14 | public void Play (string pathToAudioFile)
15 | {
16 | if (mediaPlayer != null)
17 | {
18 | mediaPlayer.Completion -= MediaPlayer_Completion;
19 | mediaPlayer.Stop ();
20 | }
21 |
22 | if (pathToAudioFile != null)
23 | {
24 | if (mediaPlayer == null)
25 | {
26 | mediaPlayer = new MediaPlayer ();
27 |
28 | mediaPlayer.Prepared += (sender, args) =>
29 | {
30 | mediaPlayer.Start ();
31 | mediaPlayer.Completion += MediaPlayer_Completion;
32 | };
33 | }
34 |
35 | mediaPlayer.Reset ();
36 | //_mediaPlayer.SetVolume (1.0f, 1.0f);
37 |
38 | mediaPlayer.SetDataSource (pathToAudioFile);
39 | mediaPlayer.PrepareAsync ();
40 | }
41 | }
42 |
43 | void MediaPlayer_Completion (object sender, EventArgs e)
44 | {
45 | FinishedPlaying?.Invoke (this, EventArgs.Empty);
46 | }
47 |
48 | public void Pause ()
49 | {
50 | mediaPlayer?.Pause ();
51 | }
52 |
53 | public void Play ()
54 | {
55 | mediaPlayer?.Start ();
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("AudioRecord.Forms.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("AudioRecord.Forms.Android")]
14 | [assembly: AssemblyCopyright("Copyright © 2014")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
32 | // Add some common permissions, these can be removed if not needed
33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
35 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.UWP/AudioPlayer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Windows.ApplicationModel.Core;
4 | using Windows.Media.Core;
5 | using Windows.Media.Playback;
6 | using Windows.Storage;
7 | using Windows.Storage.Streams;
8 | using Windows.UI.Core;
9 |
10 | namespace Plugin.AudioRecorder
11 | {
12 | public partial class AudioPlayer
13 | {
14 | MediaPlayer audioPlayer;
15 |
16 | public AudioPlayer ()
17 | {
18 | audioPlayer = new MediaPlayer ();
19 | audioPlayer.MediaEnded += AudioPlayer_MediaEnded;
20 | }
21 |
22 | public void Play (string pathToAudioFile)
23 | {
24 | _ = PlayAudio (pathToAudioFile);
25 | }
26 |
27 | async Task PlayAudio (string pathToAudioFile)
28 | {
29 | StorageFolder temporaryFolder = ApplicationData.Current.TemporaryFolder;
30 |
31 | var storageFile = await StorageFile.GetFileFromPathAsync (pathToAudioFile);
32 |
33 | IRandomAccessStream stream = await storageFile.OpenAsync (FileAccessMode.Read);
34 | audioPlayer.Source = MediaSource.CreateFromStream (stream, storageFile.FileType);
35 | audioPlayer.Play ();
36 | }
37 |
38 | async void AudioPlayer_MediaEnded (MediaPlayer sender, object args)
39 | {
40 | await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync (CoreDispatcherPriority.Normal, () =>
41 | {
42 | FinishedPlaying?.Invoke (this, EventArgs.Empty);
43 | });
44 | }
45 |
46 | public void Pause ()
47 | {
48 | audioPlayer?.Pause ();
49 | }
50 |
51 | public void Play ()
52 | {
53 | audioPlayer?.Play ();
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
26 |
27 |
30 |
31 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UISupportedInterfaceOrientations
11 |
12 | UIInterfaceOrientationPortrait
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 | UISupportedInterfaceOrientations~ipad
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationPortraitUpsideDown
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | MinimumOSVersion
24 | 8.0
25 | CFBundleDisplayName
26 | AudioRecord.Forms
27 | CFBundleIdentifier
28 | com.companyname.AudioRecord.Forms
29 | CFBundleVersion
30 | 1.0
31 | UILaunchStoryboardName
32 | LaunchScreen
33 | CFBundleName
34 | AudioRecord.Forms
35 | XSAppIconAssets
36 | Assets.xcassets/AppIcon.appiconset
37 | NSMicrophoneUsageDescription
38 | AudioRecord.Forms wants to use your microphone to record audio
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("AudioRecord.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("AudioRecord.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("50c7b8c9-e664-45af-b88e-0c9b8b9c1be1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("AudioRecord.Forms.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("AudioRecord.Forms.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Shared/IAudioStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Plugin.AudioRecorder
5 | {
6 | internal interface IAudioStream
7 | {
8 | ///
9 | /// Occurs when new audio has been streamed.
10 | ///
11 | event EventHandler OnBroadcast;
12 |
13 | ///
14 | /// Occurs when the audio stream active status changes.
15 | ///
16 | event EventHandler OnActiveChanged;
17 |
18 | ///
19 | /// Occurs when there's an error while capturing audio.
20 | ///
21 | event EventHandler OnException;
22 |
23 | ///
24 | /// Gets the sample rate.
25 | ///
26 | ///
27 | /// The sample rate.
28 | ///
29 | int SampleRate { get; }
30 |
31 | ///
32 | /// Gets the channel count.
33 | ///
34 | ///
35 | /// The channel count.
36 | ///
37 | int ChannelCount { get; }
38 |
39 | ///
40 | /// Gets bits per sample.
41 | ///
42 | int BitsPerSample { get; }
43 |
44 | ///
45 | /// Gets a value indicating if the audio stream is active.
46 | ///
47 | bool Active { get; }
48 |
49 | ///
50 | /// Starts the audio stream.
51 | ///
52 | Task Start ();
53 |
54 | ///
55 | /// Stops the audio stream.
56 | ///
57 | Task Stop ();
58 |
59 | ///
60 | /// Flushes any audio bytes in memory but not yet broadcast out to any listeners.
61 | ///
62 | void Flush ();
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Android/AudioRecorderService.cs:
--------------------------------------------------------------------------------
1 | using Android.Content;
2 | using Android.Media;
3 | using System;
4 | using System.Diagnostics;
5 | using System.IO;
6 | using System.Threading.Tasks;
7 |
8 | namespace Plugin.AudioRecorder
9 | {
10 | public partial class AudioRecorderService
11 | {
12 | partial void Init ()
13 | {
14 | if (Android.OS.Build.VERSION.SdkInt > Android.OS.BuildVersionCodes.JellyBean)
15 | {
16 | try
17 | {
18 | //if the below call to AudioManager is blocking and never returning/taking forever, ensure the emulator has proper access to the system mic input
19 | var audioManager = (AudioManager) Android.App.Application.Context.GetSystemService (Context.AudioService);
20 | var property = audioManager.GetProperty (AudioManager.PropertyOutputSampleRate);
21 |
22 | if (!string.IsNullOrEmpty (property) && int.TryParse (property, out int sampleRate))
23 | {
24 | Debug.WriteLine ($"Setting PreferredSampleRate to {sampleRate} as reported by AudioManager.PropertyOutputSampleRate");
25 | PreferredSampleRate = sampleRate;
26 | }
27 | }
28 | catch (Exception ex)
29 | {
30 | Debug.WriteLine ("Error using AudioManager to get AudioManager.PropertyOutputSampleRate: {0}", ex);
31 | Debug.WriteLine ("PreferredSampleRate will remain at the default");
32 | }
33 | }
34 | }
35 |
36 | Task GetDefaultFilePath ()
37 | {
38 | return Task.FromResult (Path.Combine (Path.GetTempPath (), DefaultFileName));
39 | }
40 |
41 | void OnRecordingStarting ()
42 | {
43 | }
44 |
45 | void OnRecordingStopped ()
46 | {
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | AudioRecord.UWP
7 | Administrator
8 | Assets\StoreLogo.png
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.UWP/Properties/Plugin.AudioRecorder.UWP.rd.xml:
--------------------------------------------------------------------------------
1 |
2 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | AudioRecord.iOS
7 | CFBundleIdentifier
8 | com.companyname.AudioRecord.iOS
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1.0
13 | LSRequiresIPhoneOS
14 |
15 | MinimumOSVersion
16 | 8.0
17 | UIDeviceFamily
18 |
19 | 1
20 | 2
21 |
22 | UILaunchStoryboardName
23 | LaunchScreen
24 | UIRequiredDeviceCapabilities
25 |
26 | armv7
27 |
28 | UISupportedInterfaceOrientations
29 |
30 | UIInterfaceOrientationPortrait
31 | UIInterfaceOrientationLandscapeLeft
32 | UIInterfaceOrientationLandscapeRight
33 |
34 | UISupportedInterfaceOrientations~ipad
35 |
36 | UIInterfaceOrientationPortrait
37 | UIInterfaceOrientationPortraitUpsideDown
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | XSAppIconAssets
42 | Assets.xcassets/AppIcon.appiconset
43 | NSMicrophoneUsageDescription
44 | AudioRecord.iOS would like to use your microphone
45 | UIMainStoryboardFile
46 | Main
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/ViewController.designer.cs:
--------------------------------------------------------------------------------
1 | // WARNING
2 | //
3 | // This file has been generated automatically by Visual Studio from the outlets and
4 | // actions declared in your storyboard file.
5 | // Manual changes to this file will not be maintained.
6 | //
7 | using Foundation;
8 | using System;
9 | using System.CodeDom.Compiler;
10 | using UIKit;
11 |
12 | namespace AudioRecord.iOS
13 | {
14 | [Register ("ViewController")]
15 | partial class ViewController
16 | {
17 | [Outlet]
18 | [GeneratedCode ("iOS Designer", "1.0")]
19 | UIKit.UIButton PlayButton { get; set; }
20 |
21 | [Outlet]
22 | [GeneratedCode ("iOS Designer", "1.0")]
23 | UIKit.UIButton RecordButton { get; set; }
24 |
25 | [Outlet]
26 | [GeneratedCode ("iOS Designer", "1.0")]
27 | UIKit.UISwitch TimeoutSwitch { get; set; }
28 |
29 | [Action ("PlayButton_TouchUpInside:")]
30 | [GeneratedCode ("iOS Designer", "1.0")]
31 | partial void PlayButton_TouchUpInside (UIKit.UIButton sender);
32 |
33 | [Action ("RecordButton_TouchUpInside:")]
34 | [GeneratedCode ("iOS Designer", "1.0")]
35 | partial void RecordButton_TouchUpInside (UIKit.UIButton sender);
36 |
37 | void ReleaseDesignerOutlets ()
38 | {
39 | if (PlayButton != null) {
40 | PlayButton.Dispose ();
41 | PlayButton = null;
42 | }
43 |
44 | if (RecordButton != null) {
45 | RecordButton.Dispose ();
46 | RecordButton = null;
47 | }
48 |
49 | if (TimeoutSwitch != null) {
50 | TimeoutSwitch.Dispose ();
51 | TimeoutSwitch = null;
52 | }
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
51 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | AudioRecord.Forms.UWP
7 | 1bc87961-c437-4be2-aa22-cfa50c414288
8 | Assets\StoreLogo.png
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 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 | using UIKit;
3 |
4 | namespace Blank
5 | {
6 | // The UIApplicationDelegate for the application. This class is responsible for launching the
7 | // User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
8 | [Register("AppDelegate")]
9 | public class AppDelegate : UIApplicationDelegate
10 | {
11 | // class-level declarations
12 |
13 | public override UIWindow Window
14 | {
15 | get;
16 | set;
17 | }
18 |
19 | public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
20 | {
21 | return true;
22 | }
23 |
24 | public override void OnResignActivation(UIApplication application)
25 | {
26 | // Invoked when the application is about to move from active to inactive state.
27 | // This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
28 | // or when the user quits the application and it begins the transition to the background state.
29 | // Games should use this method to pause the game.
30 | }
31 |
32 | public override void DidEnterBackground(UIApplication application)
33 | {
34 | // Use this method to release shared resources, save user data, invalidate timers and store the application state.
35 | // If your application supports background exection this method is called instead of WillTerminate when the user quits.
36 | }
37 |
38 | public override void WillEnterForeground(UIApplication application)
39 | {
40 | // Called as part of the transiton from background to active state.
41 | // Here you can undo many of the changes made on entering the background.
42 | }
43 |
44 | public override void OnActivated(UIApplication application)
45 | {
46 | // Restart any tasks that were paused (or not yet started) while the application was inactive.
47 | // If the application was previously in the background, optionally refresh the user interface.
48 | }
49 |
50 | public override void WillTerminate(UIApplication application)
51 | {
52 | // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
53 | }
54 | }
55 | }
56 |
57 |
58 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Xamarin.Forms;
4 | using Plugin.AudioRecorder;
5 |
6 | namespace AudioRecord.Forms
7 | {
8 | public partial class MainPage : ContentPage
9 | {
10 | AudioRecorderService recorder;
11 | AudioPlayer player;
12 |
13 | public MainPage ()
14 | {
15 | InitializeComponent ();
16 |
17 | recorder = new AudioRecorderService
18 | {
19 | StopRecordingAfterTimeout = true,
20 | TotalAudioTimeout = TimeSpan.FromSeconds (15),
21 | AudioSilenceTimeout = TimeSpan.FromSeconds (2)
22 | };
23 |
24 | player = new AudioPlayer ();
25 | player.FinishedPlaying += Player_FinishedPlaying;
26 | }
27 |
28 | async void Record_Clicked (object sender, EventArgs e)
29 | {
30 | await RecordAudio ();
31 | }
32 |
33 | async Task RecordAudio ()
34 | {
35 | try
36 | {
37 | if (!recorder.IsRecording) //Record button clicked
38 | {
39 | recorder.StopRecordingOnSilence = TimeoutSwitch.IsToggled;
40 |
41 | RecordButton.IsEnabled = false;
42 | PlayButton.IsEnabled = false;
43 |
44 | //start recording audio
45 | var audioRecordTask = await recorder.StartRecording ();
46 |
47 | RecordButton.Text = "Stop Recording";
48 | RecordButton.IsEnabled = true;
49 |
50 | await audioRecordTask;
51 |
52 | RecordButton.Text = "Record";
53 | PlayButton.IsEnabled = true;
54 | }
55 | else //Stop button clicked
56 | {
57 | RecordButton.IsEnabled = false;
58 |
59 | //stop the recording...
60 | await recorder.StopRecording ();
61 |
62 | RecordButton.IsEnabled = true;
63 | }
64 | }
65 | catch (Exception ex)
66 | {
67 | //blow up the app!
68 | throw ex;
69 | }
70 | }
71 |
72 | void Play_Clicked (object sender, EventArgs e)
73 | {
74 | PlayAudio ();
75 | }
76 |
77 | void PlayAudio ()
78 | {
79 | try
80 | {
81 | var filePath = recorder.GetAudioFilePath ();
82 |
83 | if (filePath != null)
84 | {
85 | PlayButton.IsEnabled = false;
86 | RecordButton.IsEnabled = false;
87 |
88 | player.Play (filePath);
89 | }
90 | }
91 | catch (Exception ex)
92 | {
93 | //blow up the app!
94 | throw ex;
95 | }
96 | }
97 |
98 | void Player_FinishedPlaying (object sender, EventArgs e)
99 | {
100 | PlayButton.IsEnabled = true;
101 | RecordButton.IsEnabled = true;
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using AVFoundation;
2 | using Foundation;
3 | using Plugin.AudioRecorder;
4 | using UIKit;
5 |
6 | namespace AudioRecord.Forms.iOS
7 | {
8 | // The UIApplicationDelegate for the application. This class is responsible for launching the
9 | // User Interface of the application, as well as listening (and optionally responding) to
10 | // application events from iOS.
11 | [Register("AppDelegate")]
12 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
13 | {
14 | //
15 | // This method is invoked when the application has loaded and is ready to run. In this
16 | // method you should instantiate the window, load the UI into it and then make the window
17 | // visible.
18 | //
19 | // You have 17 seconds to return from this method, or iOS will terminate your application.
20 | //
21 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
22 | {
23 | global::Xamarin.Forms.Forms.Init();
24 | LoadApplication(new App());
25 |
26 | // The following are all optional settings to change the behavior on iOS
27 |
28 | // this controls whether the library will attempt to set the shared AVAudioSession category, and then reset it after recording completes
29 | AudioRecorderService.RequestAVAudioSessionCategory (AVAudioSessionCategory.PlayAndRecord);
30 | // same thing as above, forces the shared AVAudioSession into recording mode, and then reset it after recording completes
31 | AudioPlayer.RequestAVAudioSessionCategory (AVAudioSessionCategory.PlayAndRecord);
32 |
33 | // allows you to add additional code to configure/change the shared AVAudioSession before each playback instance
34 | // this can be used to alter the cateogry, audio port, check if the system will allow your app to access the session, etc.
35 | // See https://github.com/NateRickard/Plugin.AudioRecorder/issues/27 for additional info
36 | AudioPlayer.OnPrepareAudioSession = audioSession =>
37 | {
38 | // maybe force audio to route to the speaker?
39 | var success = audioSession.OverrideOutputAudioPort (AVAudioSessionPortOverride.Speaker, out NSError error);
40 |
41 | // do something else like test if the audio session can go active?
42 |
43 | //if (success)
44 | //{
45 | // audioSession.SetActive (true, out error);
46 | //}
47 | };
48 |
49 | // can also do something AFTER audio is played with this callback
50 | //AudioPlayer.OnResetAudioSession = audioSession => ...
51 |
52 | return base.FinishedLaunching(app, options);
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Resources/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Plugin.AudioRecorder;
2 | using System;
3 | using Windows.UI.Core;
4 | using Windows.UI.Xaml;
5 | using Windows.UI.Xaml.Controls;
6 |
7 | namespace AudioRecord.UWP
8 | {
9 | public sealed partial class MainPage : Page
10 | {
11 | AudioRecorderService recorder;
12 | AudioPlayer player;
13 |
14 | public MainPage()
15 | {
16 | this.InitializeComponent();
17 |
18 | recorder = new AudioRecorderService
19 | {
20 | StopRecordingOnSilence = false,
21 | StopRecordingAfterTimeout = false
22 | };
23 |
24 | //alternative event-based API can be used here in lieu of the returned recordTask used below
25 | //recorder.AudioInputReceived += Recorder_AudioInputReceived;
26 |
27 | player = new AudioPlayer ();
28 | player.FinishedPlaying += Player_FinishedPlaying;
29 | }
30 |
31 | private async void Recorder_AudioInputReceived (object sender, string audioFile)
32 | {
33 | await Dispatcher.RunAsync (CoreDispatcherPriority.Normal, () =>
34 | {
35 | recordBtn.Icon = new SymbolIcon (Symbol.Microphone);
36 | recordBtn.Label = "Record";
37 | });
38 | }
39 |
40 | private async void RecordBtn_Click (object sender, RoutedEventArgs e)
41 | {
42 | if (!recorder.IsRecording)
43 | {
44 | playBtn.IsEnabled = false;
45 | recorder.StopRecordingOnSilence = checkTimeout.IsChecked.Value;
46 |
47 | //the returned Task here will complete once recording is finished
48 | var recordTask = await recorder.StartRecording ();
49 |
50 | recordBtn.Icon = new SymbolIcon (Symbol.Stop);
51 | recordBtn.Label = "Stop";
52 |
53 | var audioFile = await recordTask;
54 |
55 | //audioFile will contain the path to the recorded audio file
56 |
57 | recordBtn.Icon = new SymbolIcon (Symbol.Microphone);
58 | recordBtn.Label = "Record";
59 | playBtn.IsEnabled = !string.IsNullOrEmpty (audioFile);
60 | }
61 | else
62 | {
63 | await recorder.StopRecording ();
64 |
65 | recordBtn.Icon = new SymbolIcon (Symbol.Microphone);
66 | recordBtn.Label = "Record";
67 | }
68 | }
69 |
70 | private void PlayBtn_Click (object sender, RoutedEventArgs e)
71 | {
72 | PlayRecordedAudio (Dispatcher);
73 | }
74 |
75 | void PlayRecordedAudio (CoreDispatcher UiDispatcher)
76 | {
77 | try
78 | {
79 | var filePath = recorder.GetAudioFilePath ();
80 |
81 | if (filePath != null)
82 | {
83 | playBtn.IsEnabled = false;
84 | recordBtn.IsEnabled = false;
85 |
86 | player.Play (filePath);
87 | }
88 | }
89 | catch (Exception ex)
90 | {
91 | //blow up the app!
92 | throw ex;
93 | }
94 | }
95 |
96 | private async void Player_FinishedPlaying (object sender, EventArgs e)
97 | {
98 | await Dispatcher.RunAsync (CoreDispatcherPriority.Normal, () =>
99 | {
100 | playBtn.IsEnabled = true;
101 | recordBtn.IsEnabled = true;
102 | });
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Android/Plugin.AudioRecorder.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {B8C80930-F686-4FB5-8506-BD4EF845FD3D}
8 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
9 | Library
10 | Plugin.AudioRecorder
11 | Plugin.AudioRecorder
12 | v8.1
13 | Resources
14 | Assets
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug
21 | DEBUG;
22 | prompt
23 | 4
24 | None
25 |
26 |
27 | true
28 | pdbonly
29 | true
30 | bin\Release
31 | prompt
32 | 4
33 | true
34 | false
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.iOS/Plugin.AudioRecorder.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {818D32EE-A561-4629-ACEA-94871C20D4A8}
8 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
9 | Library
10 | Plugin.AudioRecorder
11 | Plugin.AudioRecorder
12 | Resources
13 |
14 |
15 | true
16 | full
17 | false
18 | bin\Debug
19 | DEBUG;
20 | prompt
21 | 4
22 | iPhone Developer
23 | true
24 | true
25 | true
26 | true
27 | 25459
28 | false
29 |
30 |
31 | pdbonly
32 | true
33 | bin\Release
34 | prompt
35 | 4
36 | iPhone Developer
37 | true
38 | SdkOnly
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/ViewController.cs:
--------------------------------------------------------------------------------
1 | using AVFoundation;
2 | using Plugin.AudioRecorder;
3 | using System;
4 | using System.Threading.Tasks;
5 | using UIKit;
6 |
7 | namespace AudioRecord.iOS
8 | {
9 | public partial class ViewController : UIViewController
10 | {
11 | AudioRecorderService recorder;
12 | AudioPlayer player;
13 |
14 | public ViewController (IntPtr handle) : base (handle)
15 | {
16 | // this controls whether the library will attempt to set the shared AVAudioSession category, and then reset it after recording completes
17 | AudioRecorderService.RequestAVAudioSessionCategory (AVAudioSessionCategory.PlayAndRecord);
18 | }
19 |
20 | public override void ViewDidLoad ()
21 | {
22 | base.ViewDidLoad ();
23 |
24 | recorder = new AudioRecorderService
25 | {
26 | StopRecordingOnSilence = TimeoutSwitch.On,
27 | StopRecordingAfterTimeout = false
28 | };
29 |
30 | player = new AudioPlayer ();
31 | player.FinishedPlaying += Player_FinishedPlaying;
32 |
33 | //alternative event-based API can be used here in lieu of the returned recordTask used below
34 | //recorder.AudioInputReceived += Recorder_AudioInputReceived;
35 | }
36 |
37 | async partial void RecordButton_TouchUpInside (UIButton sender)
38 | {
39 | await RecordAudio ();
40 | }
41 |
42 | async Task RecordAudio ()
43 | {
44 | try
45 | {
46 | if (!recorder.IsRecording)
47 | {
48 | recorder.StopRecordingOnSilence = TimeoutSwitch.On;
49 |
50 | RecordButton.Enabled = false;
51 | PlayButton.Enabled = false;
52 |
53 | //the returned Task here will complete once recording is finished
54 | var recordTask = await recorder.StartRecording ();
55 |
56 | RecordButton.SetTitle ("Stop", UIControlState.Normal);
57 | RecordButton.Enabled = true;
58 |
59 | var audioFile = await recordTask;
60 |
61 | //audioFile will contain the path to the recorded audio file
62 |
63 | RecordButton.SetTitle ("Record", UIControlState.Normal);
64 | PlayButton.Enabled = !string.IsNullOrEmpty (audioFile);
65 | }
66 | else
67 | {
68 | RecordButton.Enabled = false;
69 |
70 | await recorder.StopRecording ();
71 |
72 | RecordButton.SetTitle ("Record", UIControlState.Normal);
73 | RecordButton.Enabled = true;
74 | }
75 | }
76 | catch (Exception ex)
77 | {
78 | //blow up the app!
79 | throw ex;
80 | }
81 | }
82 |
83 | private void Recorder_AudioInputReceived (object sender, string audioFile)
84 | {
85 | InvokeOnMainThread (() =>
86 | {
87 | RecordButton.SetTitle ("Record", UIControlState.Normal);
88 |
89 | PlayButton.Enabled = !string.IsNullOrEmpty (audioFile);
90 | });
91 | }
92 |
93 | partial void PlayButton_TouchUpInside (UIButton sender)
94 | {
95 | try
96 | {
97 | var filePath = recorder.GetAudioFilePath ();
98 |
99 | if (filePath != null)
100 | {
101 | PlayButton.Enabled = false;
102 | RecordButton.Enabled = false;
103 |
104 | player.Play (filePath);
105 | }
106 | }
107 | catch (Exception ex)
108 | {
109 | //blow up the app!
110 | throw ex;
111 | }
112 | }
113 |
114 | void Player_FinishedPlaying (object sender, EventArgs e)
115 | {
116 | PlayButton.Enabled = true;
117 | RecordButton.Enabled = true;
118 | }
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.iOS/Resources/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
21 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.NuGet/Plugin.AudioRecorder.NuGet.nuproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | AudioRecorder plugin for Xamarin and Windows
6 | Nate Rickard
7 | Copyright © Nate Rickard
8 | https://github.com/NateRickard/Plugin.AudioRecorder
9 | https://github.com/NateRickard/Plugin.AudioRecorder/blob/master/LICENSE
10 | AudioRecorder plugin for Xamarin and Windows
11 | xamarin, pcl, xam.pcl, plugin, plugin for xamarin, android, UWP, universal windows, xamarin.forms, ios, microphone, audio, record
12 | .NETPortable,Version=v4.5,Profile=Profile111
13 | C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v8.1\
14 | https://raw.githubusercontent.com/NateRickard/Plugin.AudioRecorder/9c4b2606/logo/icon-nuget.png
15 | true
16 |
17 |
18 | Debug
19 | AnyCPU
20 | {7ED9AE4B-267C-47C0-A816-797FBD080188}
21 | Multiplatform library for recording device microphone input
22 | Plugin.AudioRecorder
23 | 1.1.0
24 | Nate Rickard
25 | false
26 | false
27 | Exe
28 | Plugin.AudioRecorder
29 | false
30 | Plugin.AudioRecorder.NuGet
31 | v4.5
32 |
33 |
34 | true
35 | full
36 | bin\Debug
37 | prompt
38 |
39 |
40 | bin\Release
41 | prompt
42 |
43 |
44 |
45 | {B8C80930-F686-4FB5-8506-BD4EF845FD3D}
46 | Plugin.AudioRecorder.Android
47 |
48 |
49 | {818D32EE-A561-4629-ACEA-94871C20D4A8}
50 | Plugin.AudioRecorder.iOS
51 |
52 |
53 |
54 | {E539C217-D04B-49A7-B4DB-80B277FB2210}
55 | Plugin.AudioRecorder
56 |
57 |
58 |
59 |
60 | 0.2.5-dev.1
61 | All
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.iOS/AudioRecorderService.cs:
--------------------------------------------------------------------------------
1 | using AVFoundation;
2 | using Foundation;
3 | using System;
4 | using System.Diagnostics;
5 | using System.IO;
6 | using System.Threading.Tasks;
7 |
8 | namespace Plugin.AudioRecorder
9 | {
10 | public partial class AudioRecorderService
11 | {
12 | NSString currentAVAudioSessionCategory;
13 |
14 | static AVAudioSessionCategory? requestedAVAudioSessionCategory;
15 |
16 | ///
17 | /// If is used to request an AVAudioSession category, this Action will also be run to configure the before recording audio.
18 | ///
19 | public static Action OnPrepareAudioSession;
20 |
21 | ///
22 | /// If is used to request an AVAudioSession category, this Action will also be run to reset or re-configure the after audio recording is complete.
23 | ///
24 | public static Action OnResetAudioSession;
25 |
26 | partial void Init () { }
27 |
28 | ///
29 | /// Call this method in your iOS project if you'd like the to attempt to set the shared
30 | /// category to the requested before recording audio and return it to its previous value after recording is complete.
31 | /// The default category used will be . Note that some categories do not support recording.
32 | ///
33 | public static void RequestAVAudioSessionCategory (AVAudioSessionCategory category = AVAudioSessionCategory.PlayAndRecord)
34 | {
35 | requestedAVAudioSessionCategory = category;
36 | }
37 |
38 | Task GetDefaultFilePath ()
39 | {
40 | return Task.FromResult (Path.Combine (Path.GetTempPath (), DefaultFileName));
41 | }
42 |
43 | void OnRecordingStarting ()
44 | {
45 | if (requestedAVAudioSessionCategory.HasValue)
46 | {
47 | // If the user has called RequestAVAudioSessionCategory(), let's attempt to set that category for them
48 | // see: https://developer.apple.com/library/archive/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html#//apple_ref/doc/uid/TP40007875-CH10
49 | var audioSession = AVAudioSession.SharedInstance ();
50 |
51 | if (!audioSession.Category.ToString ().EndsWith (requestedAVAudioSessionCategory.Value.ToString ()))
52 | {
53 | // track the current category, as long as we haven't already done this (or else we may capture the category we're setting below)
54 | if (currentAVAudioSessionCategory == null)
55 | {
56 | currentAVAudioSessionCategory = audioSession.Category;
57 | }
58 |
59 | var err = audioSession.SetCategory (requestedAVAudioSessionCategory.Value);
60 |
61 | if (err != null)
62 | {
63 | throw new Exception ($"Current AVAudioSession category is ({currentAVAudioSessionCategory}); Application requested an AVAudioSession category of {requestedAVAudioSessionCategory.Value} but received error when attempting to set it: {err}");
64 | }
65 | }
66 |
67 | // allow for additional audio session config
68 | OnPrepareAudioSession?.Invoke (audioSession);
69 | }
70 | }
71 |
72 | void OnRecordingStopped ()
73 | {
74 | if (currentAVAudioSessionCategory != null)
75 | {
76 | var audioSession = AVAudioSession.SharedInstance ();
77 |
78 | if (audioSession.SetCategory (currentAVAudioSessionCategory, out NSError err))
79 | {
80 | currentAVAudioSessionCategory = null; //reset this if success, otherwise hang onto it to possibly try again
81 | }
82 | else
83 | {
84 | // we won't error out here as this likely won't prevent us from stopping properly... but we will log an issue
85 | Debug.WriteLine ($"Error attempting to set the AVAudioSession category back to {currentAVAudioSessionCategory} :: {err}");
86 | }
87 |
88 | // allow for additional audio session reset/config
89 | OnResetAudioSession?.Invoke (audioSession);
90 | }
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/Plugin.AudioRecorder.Shared/WaveRecorder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Plugin.AudioRecorder
8 | {
9 | internal class WaveRecorder : IDisposable
10 | {
11 | string audioFilePath;
12 | FileStream fileStream;
13 | StreamWriter streamWriter;
14 | BinaryWriter writer;
15 | int byteCount;
16 | IAudioStream audioStream;
17 |
18 | ///
19 | /// Starts recording WAVE format audio from the audio stream.
20 | ///
21 | /// A that provides the audio data.
22 | /// The full path of the file to record audio to.
23 | public async Task StartRecorder (IAudioStream stream, string filePath)
24 | {
25 | if (stream == null)
26 | {
27 | throw new ArgumentNullException (nameof (stream));
28 | }
29 |
30 | try
31 | {
32 | //if we're restarting, let's see if we have an existing stream configured that can be stopped
33 | if (audioStream != null)
34 | {
35 | await audioStream.Stop ();
36 | }
37 |
38 | audioFilePath = filePath;
39 | audioStream = stream;
40 |
41 | fileStream = new FileStream (filePath, FileMode.Create, FileAccess.Write, FileShare.Read);
42 | streamWriter = new StreamWriter (fileStream);
43 | writer = new BinaryWriter (streamWriter.BaseStream, Encoding.UTF8);
44 |
45 | byteCount = 0;
46 | audioStream.OnBroadcast += OnStreamBroadcast;
47 | audioStream.OnActiveChanged += StreamActiveChanged;
48 |
49 | if (!audioStream.Active)
50 | {
51 | await audioStream.Start ();
52 | }
53 | }
54 | catch (Exception ex)
55 | {
56 | Debug.WriteLine ("Error in WaveRecorder.StartRecorder(): {0}", ex.Message);
57 |
58 | StopRecorder ();
59 | throw;
60 | }
61 | }
62 |
63 | ///
64 | /// Gets a new to the audio file in readonly mode.
65 | ///
66 | /// A object that can be used to read the audio file from the beginning.
67 | public Stream GetAudioFileStream ()
68 | {
69 | //return a new stream to the same audio file, in Read mode
70 | return new FileStream (audioFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
71 | }
72 |
73 | void StreamActiveChanged (object sender, bool active)
74 | {
75 | if (!active)
76 | {
77 | StopRecorder ();
78 | }
79 | }
80 |
81 | void OnStreamBroadcast (object sender, byte [] bytes)
82 | {
83 | try
84 | {
85 | if (writer != null && streamWriter != null)
86 | {
87 | writer.Write (bytes);
88 | byteCount += bytes.Length;
89 | }
90 | }
91 | catch (Exception ex)
92 | {
93 | Debug.WriteLine ("Error in WaveRecorder.OnStreamBroadcast(): {0}", ex.Message);
94 |
95 | StopRecorder ();
96 | }
97 | }
98 |
99 | ///
100 | /// Stops recording WAV audio from the underlying and finishes writing the WAV file.
101 | ///
102 | public void StopRecorder ()
103 | {
104 | try
105 | {
106 | if (audioStream != null)
107 | {
108 | audioStream.OnBroadcast -= OnStreamBroadcast;
109 | audioStream.OnActiveChanged -= StreamActiveChanged;
110 | }
111 |
112 | if (writer != null)
113 | {
114 | if (streamWriter.BaseStream.CanWrite)
115 | {
116 | //now that audio is finished recording, write a WAV/RIFF header at the beginning of the file
117 | writer.Seek (0, SeekOrigin.Begin);
118 | AudioFunctions.WriteWavHeader (writer, audioStream.ChannelCount, audioStream.SampleRate, audioStream.BitsPerSample, byteCount);
119 | }
120 |
121 | writer.Dispose (); //this should properly close/dispose the underlying stream as well
122 | writer = null;
123 | fileStream = null;
124 | streamWriter = null;
125 | }
126 |
127 | audioStream = null;
128 | }
129 | catch (Exception ex)
130 | {
131 | Debug.WriteLine ("Error during StopRecorder: {0}", ex.Message);
132 | throw;
133 | }
134 | }
135 |
136 | public void Dispose ()
137 | {
138 | StopRecorder ();
139 | }
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/Samples/Forms/AudioRecord.Forms.UWP/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.ApplicationModel;
7 | using Windows.ApplicationModel.Activation;
8 | using Windows.Foundation;
9 | using Windows.Foundation.Collections;
10 | using Windows.UI.Xaml;
11 | using Windows.UI.Xaml.Controls;
12 | using Windows.UI.Xaml.Controls.Primitives;
13 | using Windows.UI.Xaml.Data;
14 | using Windows.UI.Xaml.Input;
15 | using Windows.UI.Xaml.Media;
16 | using Windows.UI.Xaml.Navigation;
17 |
18 | namespace AudioRecord.Forms.UWP
19 | {
20 | ///
21 | /// Provides application-specific behavior to supplement the default Application class.
22 | ///
23 | sealed partial class App : Application
24 | {
25 | ///
26 | /// Initializes the singleton application object. This is the first line of authored code
27 | /// executed, and as such is the logical equivalent of main() or WinMain().
28 | ///
29 | public App()
30 | {
31 | this.InitializeComponent();
32 | this.Suspending += OnSuspending;
33 | }
34 |
35 | ///
36 | /// Invoked when the application is launched normally by the end user. Other entry points
37 | /// will be used such as when the application is launched to open a specific file.
38 | ///
39 | /// Details about the launch request and process.
40 | protected override void OnLaunched(LaunchActivatedEventArgs e)
41 | {
42 |
43 |
44 | Frame rootFrame = Window.Current.Content as Frame;
45 |
46 | // Do not repeat app initialization when the Window already has content,
47 | // just ensure that the window is active
48 | if (rootFrame == null)
49 | {
50 | // Create a Frame to act as the navigation context and navigate to the first page
51 | rootFrame = new Frame();
52 |
53 | rootFrame.NavigationFailed += OnNavigationFailed;
54 |
55 | Xamarin.Forms.Forms.Init(e);
56 |
57 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
58 | {
59 | //TODO: Load state from previously suspended application
60 | }
61 |
62 | // Place the frame in the current Window
63 | Window.Current.Content = rootFrame;
64 | }
65 |
66 | if (rootFrame.Content == null)
67 | {
68 | // When the navigation stack isn't restored navigate to the first page,
69 | // configuring the new page by passing required information as a navigation
70 | // parameter
71 | rootFrame.Navigate(typeof(MainPage), e.Arguments);
72 | }
73 | // Ensure the current window is active
74 | Window.Current.Activate();
75 | }
76 |
77 | ///
78 | /// Invoked when Navigation to a certain page fails
79 | ///
80 | /// The Frame which failed navigation
81 | /// Details about the navigation failure
82 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
83 | {
84 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
85 | }
86 |
87 | ///
88 | /// Invoked when application execution is being suspended. Application state is saved
89 | /// without knowing whether the application will be terminated or resumed with the contents
90 | /// of memory still intact.
91 | ///
92 | /// The source of the suspend request.
93 | /// Details about the suspend request.
94 | private void OnSuspending(object sender, SuspendingEventArgs e)
95 | {
96 | var deferral = e.SuspendingOperation.GetDeferral();
97 | //TODO: Save application state and stop any background activity
98 | deferral.Complete();
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/Samples/Native/AudioRecord.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Widget;
3 | using Android.OS;
4 | using Android.Support.V7.App;
5 | using Plugin.AudioRecorder;
6 | using System;
7 | using System.Threading.Tasks;
8 | using Android.Support.V4.Content;
9 | using Android;
10 | using Android.Content.PM;
11 | using Android.Support.V4.App;
12 |
13 | namespace AudioRecord.Android
14 | {
15 | [Activity(Label = "@string/app_name", Theme = "@style/AppTheme", MainLauncher = true)]
16 | public class MainActivity : AppCompatActivity
17 | {
18 | AudioRecorderService recorder;
19 | AudioPlayer player;
20 |
21 | Button recordButton;
22 | Button playButton;
23 |
24 | protected override void OnCreate(Bundle savedInstanceState)
25 | {
26 | base.OnCreate(savedInstanceState);
27 |
28 | // Set our view from the "main" layout resource
29 | SetContentView(Resource.Layout.activity_main);
30 |
31 | // Get our button from the layout resource,
32 | // and attach an event to it
33 | recordButton = FindViewById