This website uses cookies on its adverts and sponsored links. By clicking the "Accept" button you are consenting to their use.

Read more

Accept


Mobile Tech Tracker
≡ sections
Home

Tech Advice

Tech Thoughts

Apps

Tech News

About

Welcome to Mobile Tech Tracker. Our mission is to help technically-minded people to become better versions of themselves and to help ordinary people to use modern smart technologies to their own advantage. If you want to support us, please consider visiting the pages of our advertisers.


Playing audio on .NET Core with NetCoreAudio

For well over a decade, .NET Framework was the main software development platform that Microsoft stack programmers were using. As great as it was, it had one significant disadvantage - it could only be ran on Windows. This limitation has prompted Microsoft to release another programming platform, .NET Core, which is intended to eventually replace .NET Framework.

Unlike .NET Framework, .NET Core can run on Linux and Mac as well as Windows. However, as the platform is still very young, it lacks some of the basic functionality that .NET Framework developers learned to take for granted. Until recently, one of these missing pieces of functionality was the ability to play audio.

However, with NetCoreAudio NuGet package, this is no longer an issue.


What is NetCoreAudio

NetCoreAudio is a library with a set of simple controls. It allows you to play, pause, resume and stop audio files from your .NET Core code.

The library works on any operating system supported by .NET Core. Of course, audio plays differently on different platforms. Therefore, each OS supported by .NET Core has its own implementation of audio controls inside NetCoreAudio library.

However, the internals of the library will detects what OS the software is running on and will apply the correct implementation accordingly.

One major advantage of NetCoreAudio over other methods of audio playback on .NET Core is that it doesn't have any dependencies on third party libraries. Not only that, but it doesn't require anything other than plain .NET Core to run.

If all you want to do is create a simple background application that is capable of playing audio in the device it is running on, NetCoreAudio NuGet package is all you need.

This is what makes NetCoreAudio a better solution than, for example, inter-operability with Node.js via NodeServices. Launching NPM audio libraries from your .NET Core code will also work, but NodeServices do require the availability of ASP.NET Core components. This would make your application much heavier than it needs to be, especially if you don't intend to host any of its components over a network.

Likewise, NetCoreAudio is completely free and open-source, unlike some other NuGet packages available out there. Therefore, as well as using it as is, you can modify the code to suite your needs.

This tutorial describes how the library works. You can use this information to make your own variation of it.


Any feedback and contribution is welcome

NetCoreAudio is evolving product. And, to get it to evolve into the right direction, your feedback will be appreciated.

The GitHub page of the project has a section on it where anyone can make comments or raise issues. And you are welcome to do so.

Likewise, any contribution from other developers will be welcome. If you make any changes that would genuinely add value to the library, those will surely be merged into the master branch.

In the meantime, I hope you find this library helpful.



Written by

Posted on 14 Nov 2018

Fiodar Sazanavets is a full stack software developer with several years of experience working in various industries. In his professional career, he has mainly worked with a number of different Microsoft stack technologies, both back-end and front-end, and Java for Android. Fiodar has an Honours degree in Environmental Biology and a Masters degree in Environmental Informatics.



More from Tech Advice


Learning .NET Core from scratch

Learning .NET Core from scratch


Building .NET Core sound application - part 3

Building .NET Core sound application - part 3


Building .NET Core sound application - part 2

Building .NET Core sound application - part 2


Building .NET Core audio application - part 1

Building .NET Core audio application - part 1


Building .NET Core desktop application

Building .NET Core desktop application


How to play sound on .NET Core

How to play sound on .NET Core


How to protect your website from spammers

How to protect your website from spammers


Proven way to make programming fun

Proven way to make programming fun


Why you should care about functional programming

Why you should care about functional programming


What the heck is WebAssembly

What the heck is WebAssembly


Share this:

Facebook Google LinkedIn Twitter Become a Patron!


More from Tech Advice











Privacy Policy

© Mobile Tech Tracker. All rights reserved. Unauthorised copying of any of this website's content is prohibited under international law.

For any queries, comments or suggestions, please write to info@mobiletechtracker.co.uk.