SpeexSharp 1.2.0
dotnet add package SpeexSharp --version 1.2.0
NuGet\Install-Package SpeexSharp -Version 1.2.0
<PackageReference Include="SpeexSharp" Version="1.2.0" />
paket add SpeexSharp --version 1.2.0
#r "nuget: SpeexSharp, 1.2.0"
// Install SpeexSharp as a Cake Addin #addin nuget:?package=SpeexSharp&version=1.2.0 // Install SpeexSharp as a Cake Tool #tool nuget:?package=SpeexSharp&version=1.2.0
<div align="center">
<h1>SpeexSharp</h1>
.NET Wrapper for Speex Codec
</div>
<br/><br/>
Introduction
Speex encoding and decoding are performed frame by frame. The frame size varies when different Speex modes are used.
During encoding, the input data size must be equal to the frame size. Then, you will obtain the encoded frame. During decoding, using this data will result in an output that is consistent with the frame size.
When Variable bit-rate is not enabled, the size of the encoded frame is fixed. However, when it is enabled, the length of the encoded result becomes variable. The simplest way to define your own storage format is to add a header before the encoded frame, indicating how many bytes of data are in one frame.
You can view the TestConsole in this repository, which is a simple usage example.
<br/>
Encoding
SpeexSharp has already encapsulated SpeexEncoder for encoding use. You just need to create an instance of it and call its methods. Memory management will be handled automatically.
The following is a simple process for encoding:
- Convert the original audio to PCM format.
- Fill the original sample to make it a multiple of the frame size.
- Call the Encode method frame by frame, and then call the Write method to output the encoded results.
- Perform your own logic, such as adding a header to frames and then saving them to a file.
Speex supports two types of PCM encoding: 32-bit floating point and 16-bit signed integer. If you want to perform floating point encoding, you need to call the Encode method. If it is 16-bit signed integer, you need to call the EncodeInt method.
Note: It is best to keep the sample rate of the input audio consistent with the sample rate of the encoder in order to achieve the best encoding effect.
<br/>
Decoding
SpeexSharp has already encapsulated SpeexDecoder for decoding use. You just need to create an instance of it and call its methods. Memory management will be handled automatically.
The following is a simple process for decoding:
- Obtain a complete speex frame.
- Call the Decode method, pass in the data, and get the decoded result.
- Perform your own logic, such as concatenating the decoded data and saving it.
Speex allows decoding of lost or corrupted data. Even if only half of the Speex frame is received or the content is modified, it can still be successfully decoded. However, the audio quality will be significantly reduced.
<br/>
Native APIs
In addition to using the encapsulated SpeexEncoder and SpeexDecoder, you can also directly import the pre-written native API in the library. Most of the contents defined in libxspeex.dll have already been declared in this library.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.