Easily Record Audio with .NET MAUI and Plugin.Maui.Audio

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ต.ค. 2024

ความคิดเห็น • 52

  • @jfversluis
    @jfversluis  ปีที่แล้ว +2

    🔈Looking to play audio instead? Here it is: th-cam.com/video/oIYnEuZ9oew/w-d-xo.html

    • @iclicksoftware8618
      @iclicksoftware8618 ปีที่แล้ว

      hi, Is there a way to record and recognize speech to text at the same time?.

  • @PierreH1968
    @PierreH1968 ปีที่แล้ว

    Great add on to the plugin! Thank you Gerald!

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      Thanks Pierre! We got this question a lot, so hopefully this will be useful to people!

  • @josedonizeteoliveirajunior1744
    @josedonizeteoliveirajunior1744 ปีที่แล้ว +1

    Excellent video, as always🎉

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Thank you so much my friend!

  • @songperformer_NET
    @songperformer_NET 7 หลายเดือนก่อน

    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

    • @jfversluis
      @jfversluis  7 หลายเดือนก่อน +1

      Appreciate that! Thank you!

  • @alexandervillegas5683
    @alexandervillegas5683 9 หลายเดือนก่อน +2

    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?

    • @maxborrmann5663
      @maxborrmann5663 7 หลายเดือนก่อน

      you could compress the file server side using ffmpeg

  • @thisisyusuf
    @thisisyusuf หลายเดือนก่อน +1

    How can I retrieve the audio file path? I want to use it with the OpenAI API to convert speech into text.

    • @jfversluis
      @jfversluis  หลายเดือนก่อน

      The returning object from the stop recording method should have that information!

  • @rodrigoroglio
    @rodrigoroglio 3 หลายเดือนก่อน

    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?

    • @jfversluis
      @jfversluis  3 หลายเดือนก่อน +1

      This plugin does not, sorry!

    • @rodrigoroglio
      @rodrigoroglio 3 หลายเดือนก่อน

      @@jfversluis Do you know anyone that can? ;-)

  • @ahmadyogi1340
    @ahmadyogi1340 11 หลายเดือนก่อน

    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?

  • @lingnaixu334
    @lingnaixu334 5 หลายเดือนก่อน

    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?

  • @DeepWorksStudios
    @DeepWorksStudios ปีที่แล้ว

    Awesome Update! Keep it up :)

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      Thank you! Will definitely do!

  • @josemanuelgroo
    @josemanuelgroo 3 หลายเดือนก่อน

    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

  • @MrMacvos
    @MrMacvos 10 หลายเดือนก่อน

    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'?

    • @RalphHachache
      @RalphHachache 10 หลายเดือนก่อน

      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 ?

    • @jfversluis
      @jfversluis  10 หลายเดือนก่อน

      When you call StopAsync it will return an object that has details about the file

    • @RalphHachache
      @RalphHachache 10 หลายเดือนก่อน

      the file path is not accessible in the object, I tried it in the sample. thanks for your help
      @@jfversluis

  • @이캐리-z8w
    @이캐리-z8w ปีที่แล้ว

    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?

  • @asdasdaa7063
    @asdasdaa7063 9 หลายเดือนก่อน

    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?

  • @aDominarWanderer
    @aDominarWanderer ปีที่แล้ว

    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

  • @RalphHachache
    @RalphHachache 10 หลายเดือนก่อน

    Hello, Great tutorial, can you please show how to do the static implementation. Thanks

    • @jfversluis
      @jfversluis  10 หลายเดือนก่อน

      Check the repository for instructions. You should be able to replace the calls with just basically AudioManager.Current.CreatePlayer(await FileSystem.OpenAppPackageFileAsync("ukelele.mp3"));

    • @RalphHachache
      @RalphHachache 10 หลายเดือนก่อน

      @@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

    • @TheMaundmo1
      @TheMaundmo1 10 หลายเดือนก่อน

      @@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.

    • @jfversluis
      @jfversluis  10 หลายเดือนก่อน

      @TheMaundmo1 if you specify no path a random file is generated for you which you can retrieve from the stop method

  • @XiaoranCheng
    @XiaoranCheng 8 หลายเดือนก่อน

    the recorded audio is in the WAVE format and it is extremely large, is there anyway we can save the file as mp3?

    • @jfversluis
      @jfversluis  8 หลายเดือนก่อน +1

      Not right now, but PRs are welcome!

    • @XiaoranCheng
      @XiaoranCheng 8 หลายเดือนก่อน

      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 😂

    • @jfversluis
      @jfversluis  8 หลายเดือนก่อน

      @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? 🤓

  • @septicsolution
    @septicsolution ปีที่แล้ว

    Nice addition. Please how can we record screen (video) with .net maui? Thanks in advance

    • @jfversluis
      @jfversluis  ปีที่แล้ว +2

      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.

    • @septicsolution
      @septicsolution ปีที่แล้ว

      @@jfversluis Really quick reply. Thanks for the good work. We will wait patiently.

  • @flauberttagu
    @flauberttagu 8 หลายเดือนก่อน

    Is it possible to access to "filepath" using your plugin?

    • @jfversluis
      @jfversluis  8 หลายเดือนก่อน +1

      Sorry I'm not sure what you're asking

    • @flauberttagu
      @flauberttagu 8 หลายเดือนก่อน

      @@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.

  • @stylrart
    @stylrart 5 หลายเดือนก่อน

    it's not working - There is no IsRecording, StartAsync() and StopAsync()... ???

    • @jfversluis
      @jfversluis  5 หลายเดือนก่อน

      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

  • @dancluderay1304
    @dancluderay1304 ปีที่แล้ว

    A speech to text feature built in would be great

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      That is available in the .NET MAUI Community Toolkit!

  • @creativethinking9435
    @creativethinking9435 7 หลายเดือนก่อน

    please provide pause function for pause the audio recording

    • @jfversluis
      @jfversluis  7 หลายเดือนก่อน

      For any suggestions please open an issue on the repo!

  • @BurningZa
    @BurningZa 9 หลายเดือนก่อน

    The plugin doesn't seem to work on windows.

    • @jfversluis
      @jfversluis  9 หลายเดือนก่อน

      It should! Please open an issue on the repository with what you are seeing :)

  • @niteshdhote8493
    @niteshdhote8493 5 หลายเดือนก่อน

    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();
    }
    });
    }