SoundpadConnector provides an .NET API to programmatically interact with a local Soundpad instance.
- Requirements
- Installation
- QuickStart
- Documentation
- Examples
- Limitations
- Troubleshooting
- Contributing
- License
- Special thanks
This library is build on .NET Standard 2.0. Following plattforms are supported:
- .NET Core 2.0 or higher
- .NET Framework 4.6.1 or higher
Get the NuGet package SoundpadConnector or install via NuGet console:
PM> Install-Package SoundpadConnector
using System;
using SoundpadConnector;
namespace Examples {
class Program {
public static Soundpad Soundpad;
static void Main(string[] args)
{
Soundpad = new Soundpad();
Soundpad.StatusChanged += SoundpadOnStatusChanged;
// Note that the API is asynchronous. Make sure that Soundpad is connected before executing commands.
Soundpad.ConnectAsync();
Console.ReadLine();
}
private static void SoundpadOnStatusChanged(object sender, EventArgs e)
{
Console.WriteLine(Soundpad.ConnectionStatus);
if (Soundpad.ConnectionStatus == ConnectionStatus.Connected)
{
Soundpad.PlaySound(1);
}
}
}
}
Read the Docs online. This is still work-in-progress!
- Install Chocolatey
- Install Docfx via Chocolatey
choco install docfx -y
- Run
docfx docfx/docfx.json
in project root - Browse the output in
/docs
Browse the Examples.
- SoundpadConnector does not work with Soundpad's Demo version 3 and below.
- UWP is not supported/tested. The sandbox refuses pipe connections. Users reported that it works from Windows 10 version 2004 and above.
Soundpad calls are not transactional. You may get a response before the action happens in Soundpad. For example:
var countResult = await soundpad.GetSoundFileCount();
Console.WriteLine(countResult.Value); // 9
await soundpad.AddSound(newSoundPath);
var newCountResult = await soundpad.GetSoundFileCount();
Console.WriteLine(newCountResult.Value); // 9 again, but we're expecting 10, right?
You can wait a certain amount of time between the calls, but that won't be safe either and makes your app slow. Another way is to loop until the value changes:
var countResult = await soundpad.GetSoundFileCount();
Console.WriteLine(countResult.Value); // 9
await soundpad.AddSound(newSoundPath);
while(true) {
var newCountResult = await soundpad.GetSoundFileCount();
if(newCountResult.Value == countResult.Value) {
Console.WriteLine(newCountResult.Value); // 10
break;
}
}
You may contribute in several ways like creating new features, fixing bugs, improving documentation and examples or translating any document here to your language. Read our Code of Conduct.
MIT - Nikodem Jaworski - 2018
- Leppsoft - The Company behind Soundpad