How to Play Music In C# (Simple)

Поделиться
HTML-код
  • Опубликовано: 1 дек 2022
  • How to Play Music In C# (Simple)
    Greetings, today we are here with another C# tutorial. This C# tutorial will teach you how to play music using the SoundPlayer class in the System.Media library. This will only work with .wav files and can only be used on a Windows OS.
    The System.Media library is included with C# so no new libraries need to be installed. Playing music in C# can be done with only a few lines of code
    More tutorials will be uploaded covering more about playing music using C#.
    Tutorial on how to loop music using C#: • How to Loop Music In C...
    Tutorial on how to stop and start music using C#: • How to Stop and Play M...
    Subscribe to keep notified when I upload: tinyurl.com/SubMaxODidily
    How to Play Music In C# (Simple)

Комментарии • 15

  • @OSA413
    @OSA413 Год назад +16

    Instructions not clear, accidentally got music playing in B Flat Minor

  • @jongeduard
    @jongeduard Год назад +1

    A couple of years ago I made a small player in WPF with a MediaElement, with buttons to controll the audio and a file choose option. All just for fun and to learn a bit more about XAML.
    I designed icons in the window with Paths, which works the same way as the with SVG paths.
    But for audio (not video) you of course don't need any graphics of course. You can do it this way indeed. :)

  • @LOUISMIGUELERNA
    @LOUISMIGUELERNA Год назад

    'The file located at music.wav is not a valid wave file.' even tho i'm using sa wave sound. Is there a solution for this?

  • @theawsomeguy8814
    @theawsomeguy8814 Год назад +3

    instructions not clear, rickrolled me whole class

  • @kevinwargo9734
    @kevinwargo9734 Год назад

    Love this !!!

  • @4.2o
    @4.2o Год назад +2

    Help
    CS0246 The type or namespace name 'SoundPlayer' could not be found (are you missing a using directive or an assembly reference?)

    • @maxodidily
      @maxodidily  Год назад

      Is your project a .net core one?

    • @4.2o
      @4.2o Год назад

      @@maxodidily I just checked and the .NET framework on our school is way ouddated, so I'll try downloading a supported version.

    • @ASIRA89
      @ASIRA89 Год назад

      @@maxodidily I have the same problem and it seems my project is a .net core project. Do I have to deinstall my current .NET and install another one, or can I change my project into a .net framework project?

    • @abeldelatorre1382
      @abeldelatorre1382 2 месяца назад

      did you solve this? i have the same problem

  • @2syk4ever
    @2syk4ever Год назад

    lmao but a part is my chair
    im ngl im gonna do this in my test

  • @renanaoki714
    @renanaoki714 Год назад +1

    "How to Play Music in F#" next?

  • @elmoelmo8008
    @elmoelmo8008 Год назад +2

    Java next?

    • @maxodidily
      @maxodidily  Год назад +2

      I have a playlist of Java Music Tutorials here: ruclips.net/p/PLrqwM2iFaguigFGMfG4f4H516zVByp97N I do have other Java tutorials in the production pipeline.

    • @elmoelmo8008
      @elmoelmo8008 Год назад

      @@maxodidily Thanks!