Comments (3)
I also found this blocking issue while using the package on UWP platform, I'm waiting for an official fix on the nuget package.
from plugin.audiorecorder.
In the AudioRecorderService constructor, the Init() method is called to get the path of the file where the audio will be saved. Problem is this Init() partial method is async on the UWP part. When you use StartRecording(), since the Init() isn't awaited, it can cause crashes if the path is still null.
If you're willing to recompile the library, you can use this quick (and dirty) fix to make it work by using a loop checking the state of the path in StartRecording() :
public async Task<Task<string>> StartRecording ()
{
//quickfix
int retry = 0;
while (filePath == null)
{
if (retry++ > 10)
break;
Task.Delay(100).Wait();
}
ResetAudioDetection();
InitializeStream (PreferredSampleRate);
await recorder.StartRecorder (audioStream, filePath);
AudioStreamDetails = new AudioStreamDetails
{
ChannelCount = audioStream.ChannelCount,
SampleRate = audioStream.SampleRate,
BitsPerSample = audioStream.BitsPerSample
};
startTime = DateTime.Now;
recordTask = new TaskCompletionSource<string> ();
Debug.WriteLine ("AudioRecorderService.StartRecording() complete. Audio is being recorded.");
return recordTask.Task;
}
You can of course adjust it to your needs as a temporary solution but, ideally, the Init() method should be awaited.
from plugin.audiorecorder.
Should be fixed in #15, though I'm unable to release a package at the moment as my Windows machine needs to be rebuilt. If you need this fix, just build the project and use the DLLs directly until I have time to revisit.
from plugin.audiorecorder.
Related Issues (20)
- Stream is closed in WriteWavHeader HOT 1
- Record OK, but share it to messenger not always play HOT 4
- How to convert recorded wav file to mp3 or ogg? HOT 2
- Cross Platform library throws NullReference exception
- Audio for IOS is coming out of ear speaker and not main speakers. HOT 6
- play() not working on Xiaomi devices HOT 12
- Concurrent Streaming
- AudioRecorder C#
- Quiet voice results in null audio file. HOT 2
- iOS concurrent Stream is empty / has no length
- Is there a maintenance code for this project?
- How to start recording and wait for me to stop?
- I'm recording for about a second. I don't seem to succeed?
- Support for MacOS platform HOT 1
- Android 9 以上不支持
- Streaming Concurrent Audio does not work
- Is still in the maintenance?
- iOS - Recording won't play HOT 1
- Add a way to retrieve and set audio playback duration
- Maui version availability? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugin.audiorecorder.