mirror of
https://github.com/PABannier/bark.cpp
synced 2026-03-02 05:01:10 +01:00
maint: export function for dll in bark.h (#198)
This commit is contained in:
parent
d2b51e7424
commit
dbcb245f55
@ -20,6 +20,8 @@ set(BARK_LIB bark)
|
||||
|
||||
add_subdirectory(encodec.cpp)
|
||||
|
||||
add_definitions(-DEXPORTING_BARK)
|
||||
|
||||
add_library(${BARK_LIB} STATIC bark.cpp bark.h)
|
||||
|
||||
if (BARK_BUILD_EXAMPLES)
|
||||
|
||||
30
bark.h
30
bark.h
@ -21,6 +21,16 @@
|
||||
#include "ggml-backend.h"
|
||||
#include "ggml.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef EXPORTING_BARK
|
||||
#define BARK_API __declspec(dllexport)
|
||||
#else
|
||||
#define BARK_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define BARK_API
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -135,7 +145,7 @@ extern "C" {
|
||||
*
|
||||
* @return bark_context_params The default parameters for a bark context.
|
||||
*/
|
||||
struct bark_context_params bark_context_default_params(void);
|
||||
BARK_API struct bark_context_params bark_context_default_params(void);
|
||||
|
||||
/**
|
||||
* Loads a Bark model from the specified file path with the given parameters.
|
||||
@ -145,7 +155,7 @@ extern "C" {
|
||||
* @param seed The seed to use for random number generation.
|
||||
* @return A pointer to the loaded bark model context.
|
||||
*/
|
||||
struct bark_context *bark_load_model(
|
||||
BARK_API struct bark_context *bark_load_model(
|
||||
const char *model_path,
|
||||
struct bark_context_params params,
|
||||
uint32_t seed);
|
||||
@ -158,7 +168,7 @@ extern "C" {
|
||||
* @param n_threads The number of threads to use for generating the audio.
|
||||
* @return An integer indicating the success of the audio generation process.
|
||||
*/
|
||||
bool bark_generate_audio(
|
||||
BARK_API bool bark_generate_audio(
|
||||
struct bark_context *bctx,
|
||||
const char *text,
|
||||
int n_threads);
|
||||
@ -169,7 +179,7 @@ extern "C" {
|
||||
* @param bctx The Bark context to use for generating the audio.
|
||||
* @return A pointer to the audio data generated by the Bark context.
|
||||
*/
|
||||
float *bark_get_audio_data(
|
||||
BARK_API float *bark_get_audio_data(
|
||||
struct bark_context *bctx);
|
||||
|
||||
/**
|
||||
@ -178,7 +188,7 @@ extern "C" {
|
||||
* @param bctx The Bark context to use for generating the audio.
|
||||
* @return The size of the audio data generated by the Bark context.
|
||||
*/
|
||||
int bark_get_audio_data_size(
|
||||
BARK_API int bark_get_audio_data_size(
|
||||
struct bark_context *bctx);
|
||||
|
||||
/**
|
||||
@ -187,7 +197,7 @@ extern "C" {
|
||||
* @param bctx The Bark context to use for generating the audio.
|
||||
* @return A struct containing the statistics of the last audio generation round.
|
||||
*/
|
||||
int64_t bark_get_load_time(
|
||||
BARK_API int64_t bark_get_load_time(
|
||||
struct bark_context *bctx);
|
||||
|
||||
/**
|
||||
@ -196,7 +206,7 @@ extern "C" {
|
||||
* @param bctx The Bark context to use for generating the audio.
|
||||
* @return A struct containing the statistics of the last audio generation round.
|
||||
*/
|
||||
int64_t bark_get_eval_time(
|
||||
BARK_API int64_t bark_get_eval_time(
|
||||
struct bark_context *bctx);
|
||||
|
||||
/**
|
||||
@ -205,7 +215,7 @@ extern "C" {
|
||||
* @param bctx The Bark context to use for generating the audio.
|
||||
* @return A struct containing the statistics of the last audio generation round.
|
||||
*/
|
||||
void bark_reset_statistics(
|
||||
BARK_API void bark_reset_statistics(
|
||||
struct bark_context *bctx);
|
||||
|
||||
/**
|
||||
@ -216,7 +226,7 @@ extern "C" {
|
||||
* @param ftype The type of the model's floating-point values.
|
||||
* @return True if the model was successfully quantized and saved, false otherwise.
|
||||
*/
|
||||
bool bark_model_quantize(
|
||||
BARK_API bool bark_model_quantize(
|
||||
const char *fname_inp,
|
||||
const char *fname_out,
|
||||
enum ggml_ftype ftype);
|
||||
@ -226,7 +236,7 @@ extern "C" {
|
||||
*
|
||||
* @param bctx The bark context to free.
|
||||
*/
|
||||
void bark_free(
|
||||
BARK_API void bark_free(
|
||||
struct bark_context *bctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Loading…
Reference in New Issue
Block a user