Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Oct 22, 2024
1 parent 50a5fb6 commit dc446bc
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,21 @@ Bark.cpp integration for React Native
npm install bark.rn
```

### Setup for iOS with React Native < 0.75

1. Install `cocoapods-spm`

2. Add these lines in `Podfile`

```rb
# ...

target "YourApp" do
# ...

# Add these lines
spm_pkg "bark",
:url => "https://github.com/PABannier/bark.cpp.git",
:branch => "main",
:products => ["bark"]

# spm_pkg should be before use_native_modules!
config = use_native_modules!

# ...
end
```

## Usage


```js
import { multiply } from 'bark.rn';
import BarkContext from 'bark.rn';

// Load model
const ctx = await BarkContext.load('path/to/model.bin');

// ...
// Inference
const result = await ctx.generate('Hello, world!', 'path/to/output.wav');
// Result: { success: boolean, load_time: number, eval_time: number }

const result = await multiply(3, 7);
// Release context
await ctx.release();
```


Expand Down

0 comments on commit dc446bc

Please sign in to comment.