Thank you for teaching us how to use the audio plugin, I would like to ask you if there is any way to compress the audio, since the file it generates has a wav extension. How could we generate a file with compression and .mp3 extension?
Thank you so much. This is helpful because there is not much information available. I have actually created and run the simple program, The first StartAsync and StopAsync are successful and the Stream can be played. However, when StartAsync is executed again, a ComException occurs. Are there any points to note?
I tested on an Android emulator in Windows, but it seems like the recording file is not being saved, even though I've checked all the Android permission checkboxes. What could be the issue?
I am trying to use it in windows but not working, after starting the record and then stop the record it says not recording, any clue about it? I followed all the steps
Check the repository for instructions. You should be able to replace the calls with just basically AudioManager.Current.CreatePlayer(await FileSystem.OpenAppPackageFileAsync("ukelele.mp3"));
@@jfversluis Thank you ! your a life saver, I got one more question, if I didn't specify the name of the audio or path when recording, how can I later get its path and name
@@RalphHachache I am pretty sure, that if you did not specify a path for the recording, then it is not saved into a file. You only have access to the Stream (which is returned by StopAsync). You can however save this stream to a file wherever you want it to be.
Great tutorial and great plugin! Question: If I pass a filepath as a parameter on StartAsync(), can I then retrieve that file name later on from the 'recordedAudio' variable, like 'recordedAudio.FilePath'?
Hello, I was trying the same thing, except I didn't pass the filename (randomly generated) and still couldn't get the Filename/path. where you able to find a solution ?
Great video, congrats!!! Allow me a little question, please: I´m developing an App that need do capture the sound of surrounding just to get the DECIBEL from the local place... I'm not need to record the audio, just to know the decibels level of the surrounding... this plugin have a way to capture this measure?
I'm working on a plugin for that here: github.com/jfversluis/Plugin.Maui.ScreenRecording but Android is a bit harder and I haven't found the time to finish it.
Thank you, I ended up using Andriod's MediaRecorder directly. The recorder in the toolkit is very good and easy to implement, but the large wave format (even we can give it the .mp3 extension) made the recorder not very useful in reality as they are too large to store/transfer....after all no one wants an 5mb audio file that is only 40s long, and realizing that at the end of the development phase was a bit annoying 😂
@XiaoranCheng as mentioned: the project is open to improvements by the community. Now only you can benefit in your app, why not share it with others? 🤓
The API might have changed a bit since this video but it’s all there, check the docs: github.com/jfversluis/Plugin.Maui.Audio/blob/main/docs/audio-recorder.md
@@jfversluis the audio file is save on the device. But it is impossible to retrieve the filepath. I said that because in some cases it would be good to get the file itself for more dev options.
🔈Looking to play audio instead? Here it is: th-cam.com/video/oIYnEuZ9oew/w-d-xo.html
hi, Is there a way to record and recognize speech to text at the same time?.
Thank you for teaching us how to use the audio plugin, I would like to ask you if there is any way to compress the audio, since the file it generates has a wav extension. How could we generate a file with compression and .mp3 extension?
you could compress the file server side using ffmpeg
Great add on to the plugin! Thank you Gerald!
Thanks Pierre! We got this question a lot, so hopefully this will be useful to people!
Excellent video, as always🎉
Thank you so much my friend!
Looks cool, I will have a play with this, I was looking for something like this for a non commercial app I am developing, very well explained
Appreciate that! Thank you!
How can I retrieve the audio file path? I want to use it with the OpenAI API to convert speech into text.
The returning object from the stop recording method should have that information!
Thank you so much. This is helpful because there is not much information available.
I have actually created and run the simple program, The first StartAsync and StopAsync are successful and the Stream can be played. However, when StartAsync is executed again, a ComException occurs. Are there any points to note?
please provide pause function for pause the audio recording
For any suggestions please open an issue on the repo!
Nice video! I want to ask can it also stream the recorded audio so that we can send it let's say to websocket like that?
I have 4 tabs in my shell tab bar, if i click the 4th tab bar it should open a browser and not a content page how to achieve this in maui
I tested on an Android emulator in Windows, but it seems like the recording file is not being saved, even though I've checked all the Android permission checkboxes. What could be the issue?
I am trying to use it in windows but not working, after starting the record and then stop the record it says not recording, any clue about it? I followed all the steps
How about using Plugin.Maui.Audio in a .net maui blazor hybrid? Im new to .net maui in general but are the steps the same in a maui blazor hybrid?
Did you get this to work?
Yeah, it works, I am assuming you got that to work
Hello, Great tutorial, can you please show how to do the static implementation. Thanks
Check the repository for instructions. You should be able to replace the calls with just basically AudioManager.Current.CreatePlayer(await FileSystem.OpenAppPackageFileAsync("ukelele.mp3"));
@@jfversluis Thank you ! your a life saver, I got one more question, if I didn't specify the name of the audio or path when recording, how can I later get its path and name
@@RalphHachache I am pretty sure, that if you did not specify a path for the recording, then it is not saved into a file. You only have access to the Stream (which is returned by StopAsync). You can however save this stream to a file wherever you want it to be.
@TheMaundmo1 if you specify no path a random file is generated for you which you can retrieve from the stop method
Great tutorial and great plugin! Question: If I pass a filepath as a parameter on StartAsync(), can I then retrieve that file name later on from the 'recordedAudio' variable, like 'recordedAudio.FilePath'?
Hello, I was trying the same thing, except I didn't pass the filename (randomly generated) and still couldn't get the Filename/path. where you able to find a solution ?
When you call StopAsync it will return an object that has details about the file
the file path is not accessible in the object, I tried it in the sample. thanks for your help
@@jfversluis
Awesome Update! Keep it up :)
Thank you! Will definitely do!
Great video, congrats!!!
Allow me a little question, please: I´m developing an App that need do capture the sound of surrounding just to get the DECIBEL from the local place... I'm not need to record the audio, just to know the decibels level of the surrounding... this plugin have a way to capture this measure?
This plugin does not, sorry!
@@jfversluis Do you know anyone that can? ;-)
Nice addition. Please how can we record screen (video) with .net maui? Thanks in advance
I'm working on a plugin for that here: github.com/jfversluis/Plugin.Maui.ScreenRecording but Android is a bit harder and I haven't found the time to finish it.
@@jfversluis Really quick reply. Thanks for the good work. We will wait patiently.
A speech to text feature built in would be great
That is available in the .NET MAUI Community Toolkit!
Is there a way to get the MemoryStream instead of saving to a file?
Did you ever figure this out? Looking for same thing.
@@mm777z Same here
the recorded audio is in the WAVE format and it is extremely large, is there anyway we can save the file as mp3?
Not right now, but PRs are welcome!
Thank you, I ended up using Andriod's MediaRecorder directly.
The recorder in the toolkit is very good and easy to implement, but the large wave format (even we can give it the .mp3 extension) made the recorder not very useful in reality as they are too large to store/transfer....after all no one wants an 5mb audio file that is only 40s long, and realizing that at the end of the development phase was a bit annoying 😂
@XiaoranCheng as mentioned: the project is open to improvements by the community. Now only you can benefit in your app, why not share it with others? 🤓
it's not working - There is no IsRecording, StartAsync() and StopAsync()... ???
The API might have changed a bit since this video but it’s all there, check the docs: github.com/jfversluis/Plugin.Maui.Audio/blob/main/docs/audio-recorder.md
Is it possible to access to "filepath" using your plugin?
Sorry I'm not sure what you're asking
@@jfversluis the audio file is save on the device. But it is impossible to retrieve the filepath. I said that because in some cases it would be good to get the file itself for more dev options.
The plugin doesn't seem to work on windows.
It should! Please open an issue on the repository with what you are seeing :)
i have to save my audio on file path so how can i do it
private bool isRecording = false;
private Stopwatch stopwatch;
private System.Timers.Timer timer;
private async void Onclickstart(object sender, EventArgs e)
{
if (await Permissions.RequestAsync() != PermissionStatus.Granted)
{
return;
}
Button startButton = (Button)sender;
if (!isRecording)
{
isRecording = true;
stopwatch = new Stopwatch();
stopwatch.Restart();
stopwatch.Start();
startbuttonorg.Text = "Stop";
await _audioRecorder.StartAsync();
timer = new System.Timers.Timer(1000);
timer.Elapsed += Timer_Elapsed;
timer.Start();
}
else
{
var recordAudio = await _audioRecorder.StopAsync();
player = AudioManager.Current.CreatePlayer(recordAudio.GetAudioStream());
audioControlsStackLayout.IsVisible = true;
isRecording = false;
stopwatch.Stop();
timer.Stop();
startbuttonorg.Text = "Start";
timer.Dispose();
}
}
private async void StopRecording()
{
var recordAudio = await _audioRecorder.StopAsync();
player = AudioManager.Current.CreatePlayer(recordAudio.GetAudioStream());
audioControlsStackLayout.IsVisible = true;
isRecording = false;
stopwatch.Stop();
timer.Stop();
startbuttonorg.Text = "Start";
timer.Dispose();
}
private void Timer_Elapsed(object sender, ElapsedEventArgs e)
{
Device.BeginInvokeOnMainThread(() =>
{
TimeSpan elapsedTime = stopwatch.Elapsed;
labelTimer.Text = elapsedTime.ToString(@"mm\:ss");
if (stopwatch.Elapsed.TotalSeconds >= 30)
{
StopRecording();
}
});
}