GGWavePlayerLib 1.0.0
See the version list below for details.
dotnet add package GGWavePlayerLib --version 1.0.0
NuGet\Install-Package GGWavePlayerLib -Version 1.0.0
<PackageReference Include="GGWavePlayerLib" Version="1.0.0" />
<PackageVersion Include="GGWavePlayerLib" Version="1.0.0" />
<PackageReference Include="GGWavePlayerLib" />
paket add GGWavePlayerLib --version 1.0.0
#r "nuget: GGWavePlayerLib, 1.0.0"
#:package GGWavePlayerLib@1.0.0
#addin nuget:?package=GGWavePlayerLib&version=1.0.0
#tool nuget:?package=GGWavePlayerLib&version=1.0.0
GGWavePlayerLib
A simple and elegant NuGet package that provides an easy way to play and save GGWave audio by encoding text messages into sound waves, built with VB.NET but fully compatible with C# and F#.
π Description
GGWavePlayerLib encapsulates the GGWave encoding and audio playback logic from ggwave.net, eliminating the need for boilerplate code. With just a few lines of code, you can convert text messages into audio waves and play them through speakers or save them as WAV files.
Note: This library currently supports encoding text messages to audio waves. Decoding audio waves back into text messages is not supported at this time.
β¨ Features
- Play GGWave Audio - Directly play encoded messages through system speakers
- Save to WAV Files - Export encoded audio to standard WAV format
- Multiple Sample Rates - Choose from 4 different quality levels
- Protocol Support - Support for various GGWave protocols (audible, ultrasound, dualtone, monotone, and custom)
- Encoding Options - Support for both ASCII and UTF-8 text encoding
- Simple API - Clean, intuitive interface with minimal code required
π§ Requirements
- .NET 8.0 or higher (works with C#, F# and VB.NET)
- Dependencies:
- ggwave.net v0.2.1
- NAudio v2.2.1
π¦ Installation
Install the package via command line:
dotnet add package GGWavePlayerLib
Or using .NET CLI / Package Manager Console:
Install-Package GGWavePlayerLib
π Quick Start
Playing GGWave Audio
Imports GGWavePlayerLib
' Play a simple message with default settings
GGWavePlayer.PlayGGWave("Hello world!", GGWaveRate.CDQuality)
' Play with custom protocol and UTF-8 encoding
GGWavePlayer.PlayGGWave("εδΊεοΌδΈηοΌ",
GGWaveRate.Professional, ProtocolId.AudibleNormal, useUtf8:=True)
Saving GGWave to WAV File
Imports GGWavePlayerLib
' Save a message to a WAV file
GGWavePlayer.SaveGGWave("Secret message", GGWaveRate.CDQuality, "output.wav")
' Save with custom settings
GGWavePlayer.SaveGGWave(
"Important data", GGWaveRate.Professional, "important.wav",
ProtocolId.AudibleFastest, useUtf8:=False
)
π API Reference
GGWaveRate Enum
Represents the audio sample rate for GGWave encoding. Higher rates provide better audio quality but require more bandwidth.
| Value | Sample Rate | Description |
|---|---|---|
StandardLow |
22.05 kHz | Standard low quality - suitable for basic transmission |
StandardHigh |
24 kHz | Standard high quality - good balance of quality and size |
CDQuality |
44.1 kHz | CD audio quality - most common choice for general use |
Professional |
48 kHz | Professional audio standard - highest quality available |
ProtocolId Enum
Represents the protocol ID for GGWave encoding. These values are wrapped from the original ggwave.net.Native.ProtocolId enum.
Audible Protocols:
AudibleNormal- Standard audible transmission (default)AudibleFast- Faster audible transmissionAudibleFastest- Fastest audible transmission
Ultrasound Protocols:
UltrasoundNormal- Standard ultrasound transmissionUltrasoundFast- Faster ultrasound transmissionUltrasoundFastest- Fastest ultrasound transmission
Dualtone Protocols:
DualtoneNormal- Standard dual-tone transmissionDualtoneFast- Faster dual-tone transmissionDualtoneFastest- Fastest dual-tone transmission
Monotone Protocols:
MonotoneNormal- Standard monotone transmissionMonotoneFast- Faster monotone transmissionMonotoneFastest- Fastest monotone transmission
Custom Protocols:
Custom0throughCustom9- Custom protocol configurations
PlayGGWave Method
Plays the GGWave audio for the given message through the system speakers.
Public Sub PlayGGWave(
message As String, waveRate As GGWaveRate,
Optional protocolId As ProtocolId = ProtocolId.AudibleNormal,
Optional useUtf8 As Boolean = False
)
Parameters:
message- The text message to encode and playwaveRate- The sample rate for audio encoding (see GGWaveRate enum)protocolId- The GGWave protocol to use (default: AudibleNormal)useUtf8- Whether to use UTF-8 encoding instead of ASCII (default: False)
SaveGGWave Method
Saves the GGWave audio for the given message to a WAV file.
Public Sub SaveGGWave(
message As String, waveRate As GGWaveRate, filePath As String,
Optional protocolId As ProtocolId = ProtocolId.AudibleNormal,
Optional useUtf8 As Boolean = False
)
Parameters:
message- The text message to encode and savewaveRate- The sample rate for audio encoding (see GGWaveRate enum)filePath- The path where the WAV file will be savedprotocolId- The GGWave protocol to use (default: AudibleNormal)useUtf8- Whether to use UTF-8 encoding instead of ASCII (default: False)
π‘ Usage Tips
Choose the Right Sample Rate:
- Use
StandardLoworStandardHighfor basic applications where file size matters - Use
CDQualityfor most general-purpose applications - Use
Professionalfor high-fidelity applications
- Use
Protocol Selection:
AudibleNormalis the default and works well for most cases- Use
FastorFastestvariants for quicker transmission - Use
Ultrasoundprotocols for applications requiring inaudible transmission - Use
DualtoneorMonotonefor specific hardware compatibility
Encoding:
- Use ASCII (
useUtf8:=False) for English text and basic characters - Use UTF-8 (
useUtf8:=True) for international characters and emojis
- Use ASCII (
π License
This project is licensed under the MIT License. See the LICENSE file for details.
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
π Support
If you encounter any issues or have questions, please open an issue on the project repository.
π Acknowledgments
- Built on top of the excellent ggwave.net library
- Audio playback powered by NAudio
- Based on the GGWave project by Georgi Gerganov
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- ggwave.net (>= 0.2.1)
- NAudio (>= 2.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.