How to Parse Wav File

Introduction Audio analysis is hard. Recently, I needed a small code sample to parse a .wav file but couldn’t find anything that was working. I learned the hard way that there are a lot of combination of structures that we can take into account. In this article we will not discuss what each header does and how to use them. There are a lot of articles about that, which explain them far better than I ever could....

October 8, 2023 · Hasan Hasanov

How to Use BLE With WPF or Forms

Introduction Recently I had an idea of a project which requires using the Bluetooth API. I wanted to create something simple and did not want to use UWP for 2 reasons: I wanted to have a tray icon. This is also possible with UWP but creating a full-trust application seemed way more complicated for my scenario. I wanted a simple self-contained application which can run without the need of enabling developer mode for the end users....

April 19, 2021 · Hasan Hasanov

Back to Basics: What Is a Delegate?

Introduction One of the hardest things to explain to a beginner developer is delegate. It usually proves to be difficult because this piece of functionality’s use case is not obvious like variables, loops, collections etc. In this blog post we will explore exactly what is that thing called a delegate, where do we use them in our daily work or even if it is that important, so… What is a Delegate?...

April 5, 2021 · Hasan Hasanov

Be Careful With ZipArchive

ZipArchive’s interesting behavior Today I had an ordinary assignment. Generate an in memory .zip archive with one text file inside and send it to a web api. With C# this is straight-forward. Here is my oversimplified first attempt: using var zipStream = new MemoryStream(); using var archive = new ZipArchive(zipStream, ZipArchiveMode.Create, true); var textFileEntry = archive.CreateEntry("Test.txt", CompressionLevel.Optimal); new MemoryStream(Encoding.UTF8.GetBytes("In memory file Content")) .CopyTo(textFileEntry.Open()); // Server sending logic The code above first creates a MemoryStream which represents the complete in memory zip archive....

January 18, 2021 · Hasan Hasanov