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
- Host: GitHub
- URL: https://github.com/bartimaeusnek/csharp-libxmp-bindings
- Owner: bartimaeusnek
- License: mit
- Created: 2024-08-04T17:41:53.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-04T17:43:11.000Z (almost 2 years ago)
- Last Synced: 2025-06-13T01:42:37.841Z (12 months ago)
- Topics: csharp, libxmp, pcm, tracker-music
- Language: C#
- Homepage:
- Size: 281 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
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/)!