An open API service indexing awesome lists of open source software.

https://github.com/bartimaeusnek/csharp-libxmp-bindings

C# Bindings for libxmp
https://github.com/bartimaeusnek/csharp-libxmp-bindings

csharp libxmp pcm tracker-music

Last synced: 10 months ago
JSON representation

C# Bindings for libxmp

Awesome Lists containing this project

README

          

# C# Bindings for libxmp
libxmp is a software written in C to playback oldschool tracker (.it, .mod, etc.) files.
Sadly there is no (to my knowledge) software thats similar and has a permissive license written in C#.
So i made bindings.

## Usage
Install any NAudio backend via nuget, use DirectSound (Windows only) or write your own ``IWavePlayer`` backend. Then initialise the Xmp class with any ``IWavePlayer`` backend. I.E:
```csharp
using var xmp = new Xmp(new DirectSoundOut());
```

To play the file just call (for async):
```csharp
var playtask = xmp.PlayAsync(path-to-file);

await playtask;
```
or as blocking call:
```csharp
xmp.PlayBlocking(path-to-file);
```

For name of the song and file-format call:
```csharp
xmp.TestModule(path-to-file, out var testInfo);
```
And for duration call:
```csharp
xmp.GetEstimatedTotalPlayTime(path-to-file);
```

## Special Thanks to the [libxmp](https://github.com/libxmp/libxmp) project, aswell as the [ClangSharpPInvokeGenerator](https://github.com/dotnet/clangsharp/)!