open-index/open-npm huggingface dataset:
npm package: @speechkit/speechkit-audio-player
Description: A web player component that can play audio from https://speechkit.io
Author: Kostas Vaggelakos
Latest version: 3.18.30

# 🤖 Speechkit.io Audio Player

A library that can be used for playing podcasts from [https://speechkit.io](https://speechkit.io).


## Installation
Firstly, clone this repo to your local machine:
`git clone https://github.com/SpeechKit/speechkit-audio-player`

Next, open the `speechkit-audio-player` directory or the directory you cloned to and run `npm install` to install all dependencies.

You can now run `npm start` to begin serving on local host and you will find test pages within the `/example` directory.

## Development
To make changes, create a new branch from *develop*.
Make sure you use the following format:

*fix/sk-[task-number]*  - for a bug fix

*feat/sk-[task-number]* - for a feature

Where [task-number] represents the issue number in Trello.

Push your branch up to GitHub frequently and once you have completed work on the feature/fix, create a pull request against develop, making sure you also update the version in the package.json, eg `3.14.16`.

## Testing and Deployment

The next step is to deploy this version to staging for testing.

1. Create a new build by running `yarn build:stage`
2. Login to AWS and open the `s3/speechkit-js` bucket
3. Create new folder according the version number you want
4. Upload the contents of the local `dist` folder into the folder you created
5. Update the version in the Heroku env (Vlad will help here!)

Once testing is complete, the next step is to make a pull request from develop to master.

If everything looks good, merge into master and push the branch up, at which point CircleCI will automatically deploy to npmjs.org. The new version may take some time to appear due to caching. For an urgent release, the caches may be purged (see links below).

### CDN
We use JSDelivr for CDN. You can point your source to: `https://cdn.jsdelivr.net/npm/@speechkit/speechkit-audio-player@VERSION/dist/speechkit.js`

Example: [https://cdn.jsdelivr.net/npm/@speechkit/speechkit-audio-player@1/dist/speechkit.js](https://cdn.jsdelivr.net/npm/@speechkit/speechkit-audio-player@1/dist/speechkit.js)


#### Purging
After you have deployed a new version to JSDelivr, @latest and all other tags may take up to 24 hours to update. In the case that you need files to update sooner, you can purge the cache using the URLs below:

Purge Player:

<https://purge.jsdelivr.net/npm/@speechkit/speechkit-audio-player@latest/dist/speechkit-iframe-helper.js>

<https://purge.jsdelivr.net/npm/@speechkit/speechkit-audio-player@latest/dist/speechkit-player.js>

Purge Ghost:

<https://purge.jsdelivr.net/npm/@speechkit/speechkit-audio-player@latest/dist/speechkit-ghost.js>
npm package: @speechkit/speechkit-audio-player-v2
Description: A library that can be used for playing podcasts from https://beyondwords.io
Author: beyondwords
Latest version: 0.0.23

# 🤖 beyondwords.io Audio Player

A library that can be used for playing podcasts from [https://beyondwords.io](https://beyondwords.io).

## Installation

### CDN

We use JSDelivr for CDN. You can point your source to: `https://cdn.jsdelivr.net/npm/@speechkit/speechkit-audio-player-v2@VERSION/dist/module/index.js`
npm package: @speechly/demo-navigation
Description: Global navigation component for our demos
Author: Speechly
Latest version: 0.3.0

# Speechly Demo Navigation

Global navigation component for our [demos](https://demos.speechly.com).

[![build](https://github.com/speechly/demo-navigation/actions/workflows/version-publish.yml/badge.svg?branch=main)](https://github.com/speechly/demo-navigation/actions/workflows/version-publish.yml) [![npm](https://img.shields.io/npm/v/@speechly/demo-navigation?color=cb3837&logo=npm)](https://www.npmjs.com/package/@speechly/demo-navigation)

## Local development

This repo contains a minimal react app for easier local development. To get started, run the following commands.

Install dependencies:

```
npm install
```

Fire up development server:

```
npm start
```

Test that it builds:

```
npm run build
```

## Publishing a new version

- Trigger a new [version bump and publish to NPM](https://github.com/speechly/demo-navigation/actions/workflows/version-publish.yml) workflow
- Specify the version per [semver convention](https://docs.npmjs.com/cli/v9/commands/npm-version#description)
npm package: @speechly/react-ui
Description: Speechly UI Components
Author: Speechly
Latest version: 2.7.5

<div align="center" markdown="1">
<br/>

![speechly-logo-duo-black](https://user-images.githubusercontent.com/2579244/193574443-130d16d6-76f1-4401-90f2-0ed753b39bc0.svg)

[Website](https://www.speechly.com/)
&ensp;&middot;&ensp;
[Docs](https://docs.speechly.com/)
&ensp;&middot;&ensp;
[Support](https://github.com/speechly/speechly/discussions)
&ensp;&middot;&ensp;
[Blog](https://www.speechly.com/blog/)
&ensp;&middot;&ensp;
[Login](https://api.speechly.com/dashboard/)

<br/>
</div>

# Speechly React UI Components

![build](https://img.shields.io/github/actions/workflow/status/speechly/ui-components/build.yaml?branch=main&logo=github)
[![npm](https://img.shields.io/npm/v/@speechly/react-ui?color=cb3837&logo=npm)](https://www.npmjs.com/package/@speechly/react-ui)
[![license](http://img.shields.io/:license-mit-blue.svg)](/LICENSE)

Ready-made UI components for building reactive voice interface using React and Speechly.

> 🚧 This project is no longer actively maintained and is looking for a maintainer. If you're interested, get in touch https://www.speechly.com/contact

![image](https://user-images.githubusercontent.com/2579244/220076001-fc7e3dab-da21-4909-9891-af933a91755a.png)

## Documentation

- [Getting started with Speechly](https://docs.speechly.com/basics/getting-started)
- [Speechly UI components](https://dreamy-cori-a02de1.netlify.app/ui-components/)
- [API reference](./docs/README.md)

## Getting started

You'll need a [Speechly account](https://api.speechly.com/dashboard/) and a Speechly application that's using a Conformer model. Follow our [quick start guide](https://docs.speechly.com/basics/getting-started) to get started with Speechly.

## Installing

Install Speechly React Client and Speechly React UI Components:

```
npm install @speechly/react-client
npm install @speechly/react-ui
```

Import `SpeechProvider` and wrap the app with it, passing the **App ID** of your Speechly application:

```jsx
// index.js
import { SpeechProvider } from '@speechly/react-client';

<React.StrictMode>
  <SpeechProvider appId="YOUR_APP_ID">
    <App />
  </SpeechProvider>
</React.StrictMode>
```

## Usage

Import the required UI components and take them into use:

```jsx
// App.js
import {
  PushToTalkButton,
  BigTranscript,
  IntroPopup
} from "@speechly/react-ui";

function App() {
  return (
    <div className="App">
      <BigTranscript placement="top" />
      <PushToTalkButton placement="bottom" captureKey=" " />
      <IntroPopup />
    </div>
  );
}
```

Start the development server:

```bash
npm run start
```

Navigate to http://localhost:3000 to see your app running!

## Contributing

See contribution guide in [CONTRIBUTING.md](https://github.com/speechly/speechly/blob/main/CONTRIBUTING.md).
npm package: @speechly/react-voice-forms
Description: Speechly voice form components for React
Author: Speechly
Latest version: 1.3.6

<div align="center" markdown="1">
<br/>

![speechly-logo-duo-black](https://user-images.githubusercontent.com/2579244/193574443-130d16d6-76f1-4401-90f2-0ed753b39bc0.svg)

[Website](https://www.speechly.com/)
&ensp;&middot;&ensp;
[Docs](https://docs.speechly.com/)
&ensp;&middot;&ensp;
[Support](https://github.com/speechly/speechly/discussions)
&ensp;&middot;&ensp;
[Blog](https://www.speechly.com/blog/)
&ensp;&middot;&ensp;
[Login](https://api.speechly.com/dashboard/)

<br/>
</div>

# Speechly voice form components for React

![build](https://img.shields.io/github/actions/workflow/status/speechly/ui-components/build.yaml?branch=main&logo=github)
[![npm](https://img.shields.io/npm/v/@speechly/react-voice-forms?color=cb3837&logo=npm)](https://www.npmjs.com/package/@speechly/react-voice-forms)
[![license](http://img.shields.io/:license-mit-blue.svg)](/LICENSE)

Ready-made React form components that can be controlled with voice using Speechly. They also work with other modalities like tap, pointer and keyboard.

> 🚧 This project is no longer actively maintained and is looking for a maintainer. If you're interested, get in touch https://www.speechly.com/contact

## Documentation

- [Getting started with Speechly](https://docs.speechly.com/basics/getting-started)
- [Voice form components](https://dreamy-cori-a02de1.netlify.app/ui-components/voice-forms/)
- [Speechly UI components](https://dreamy-cori-a02de1.netlify.app/ui-components/)
- [API reference](./docs/README.md)

## Usage

Install Speechly React Client and Speechly React voice form components:

```bash
npm install @speechly/react-client
npm install @speechly/react-voice-forms
```

Include the components:

```jsx
import {
  VoiceDatePicker,
  VoiceCheckbox,
  VoiceInput,
  VoiceSelect,
  VoiceToggle,
} from '@speechly/react-voice-forms';
```

Place the form components inside your `SpeechProvider` block:

```jsx
import { SpeechProvider } from '@speechly/react-client';

<SpeechProvider appId="YOUR-APP-ID">
  <VoiceInput label="From" changeOnEntityType="from" />
</SpeechProvider>
```

## Styling

Add a `voice-form-theme-mui.css` to your `src` folder, then include it in `index.tsx`:

```
import "voice-form-theme-mui.css";
```
npm package: @speechmatics/auth
Description: Library for fetching temporary keys for Speechmatics APIs
Latest version: 0.1.0

# Speechmatics authentication 🔑

Library for managing authentication with Speechmatics APIs

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

## Installation

```sh
npm i @speechmatics/auth
```

## Usage

```typescript
import { RealtimeClient } from '@speechmatics/real-time-client';
import { createSpeechmaticsJWT } from '@speechmatics/auth';

const client = new RealtimeClient();

client.addEventListener('receiveMessage', ({ data }) => {
  // Handle transcription messages
});

async function transcribeFileRealtime () {
  const jwt = await createSpeechmaticsJWT({
    type: 'rt',
    apiKey,
    ttl: 60, // 1 minute
  });

  const fileStream = fs.createReadStream(
    path.join(__dirname, './example.wav'),
    {
      highWaterMark: 4096, //avoid sending faster than realtime
    },
  );

  await client.start(jwt, {
    transcription_config: {
      language: 'en',
      enable_partials: true,
    },
  });

  //send it
  fileStream.on('data', (sample) => {
    client.sendAudio(sample);
  });

  //end the session
  fileStream.on('end', () => {
    client.stopRecognition();
  });
}

transcribeFileRealtime();
```

## Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
npm package: @speechmatics/batch-client
Description: Javascript client for the Speechmatics batch jobs API
Latest version: 5.1.0

# Speechmatics batch client 💬

Official JS client for the Speechmatics batch jobs API.

API documentation can be found here: https://docs.speechmatics.com/jobsapi#tag/jobs

## Installation

```
npm i @speechmatics/batch-client
```

## Usage

More examples will be available soon. For now, you can checkout the [NodeJS example](/examples/nodejs/batch-example.ts).

This package exports a `BatchClient` class which can be used to call the batch job API endpoints.

### API keys 🔑

Note that the `apiKey` field of the `BatchClient` may be either a long lived API key, or a short-lived JWT.

If it is a short-lived JWT, the developer is responsible for making sure the key is valid.

You can generate a long-lived API key through our self service portal here: https://portal.speechmatics.com/api-keys

See our documentation about generating short-lived JWTs here: https://docs.speechmatics.com/introduction/authentication
npm package: @speechmatics/expo-two-way-audio
Description: Native module for two way audio streaming
Author: Speechmatics
Latest version: 0.1.2

# Speechmatics Two Way Audio

Expo module for capturing and playing pcm audio data in react-native apps (iOS and Android).

The aim of the module is to facilitate creating real-time conversational apps. The following features are provided:

- Request audio recording permissions
- Get clean (applying Acoustic Echo Cancelling) microphone samples in PCM format (1 channel 16 bit at 16kHz)
- Play audio samples in PCM format (1 channel 16 bit at 16kHz). Playback happens trough main speaker unless external audio sources are connected.
- Provide volume level both for the input and output samples. Float between 0 and 1.
- [iOS only] Get microphone mode and prompt user to select a microphone mode.

Check out our [examples/](./examples) to see the module in action.

## Installation

```
npm i @speechmatics/expo-two-way-audio
```

## Usage

Please check out our [examples/](./examples) to get full sample code.

1. Request permissions for recording audio

   ```JSX
   import {useMicrophonePermissions} from "@speechmatics/expo-two-way-audio";

   const [micPermission, requestMicPermission] = useMicrophonePermissions();
   console.log(micPermission);
   ```

1. Initialize the module before calling any audio functionality.

   ```JSX
   useEffect(() => {
       const initializeAudio = async () => {
           await initialize();
       };
       initializeAudio();
   }, []);

   ```

1. Play audio

   > [!NOTE]
   > The sample below uses the `buffer` module:
   > `npm install buffer`

   ```JSX
    import { Buffer } from "buffer";

    // As an example, let's play pcm data hardcoded in a variable.
    // The examples/basic-usage does this. Check it out for real base64 data.
    const audioChunk = "SOME PCM DATA BASE64 ENCODED HERE"
    const buffer = Buffer.from(audioChunk, "base64");
    const pcmData = new Uint8Array(buffer);
    playPCMData(pcmData);
   ```

1. Get microphone samples

   ```JSX
   // Set up a function to deal with microphone sample events.
   // In this case just print the data in the console.
   useExpoTwoWayAudioEventListener(
       "onMicrophoneData",
       useCallback<MicrophoneDataCallback>((event) => {
           console.log(`MIC DATA: ${event.data}`);
       }, []),
   );

   // Unmute the microphone to get microphone data events
   toggleRecording(true);
   ```

## Notes

Some audio features of expo-two-way-audio like Acoustic Echo Cancelling, noise reduction or microphone modes (iOS) don't work on simulator. Run the example on a real device to test these features.

```bash
# iOS
npx expo run:ios --device --configuration Release

# Android
npx expo run:android --device --variant release
```

For Android, the following permissions are needed: `RECORD_AUDIO`, `MODIFY_AUDIO_SETTINGS`. In Expo apps they can bee added in your `app.json` file:

```javascript
expo.android.permissions: ["RECORD_AUDIO", "MODIFY_AUDIO_SETTINGS"]
```
npm package: @speechmatics/real-time-client
Description: Client for the Speechmatics real-time API
Latest version: 8.3.1


# Speechmatics real-time client 🎤

Official JS client for the Speechmatics real-time transcription API.

API documentation can be found here: https://docs.speechmatics.com/rt-api-ref

## Installation

```
npm i @speechmatics/real-time-client
```

> [!WARNING]  
> For React Native, make sure to install the [`event-target-polyfill`](https://www.npmjs.com/package/event-target-polyfill) package, or any other polyfill for the [`EventTarget` class](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)

## Usage

More examples will be available soon. For now, you can checkout the [NodeJS example](/examples/nodejs/real-time-file-example.ts).

### API keys 🔑

You can generate a long-lived API key through our self service portal here: https://portal.speechmatics.com/api-keys

See our documentation about generating short-lived JWTs here: https://docs.speechmatics.com/introduction/authentication
npm package: @speechmatics/web-pcm-player
Description: Library for playing PCM audio in the browser
Latest version: 1.0.0

# Web PCM audio player

Package for playing PCM audio in the browser. Both signed 16-bit int and 32-bit float encodings are supported.

The player requires a given `AudioContext` to play audio within. It does not manage/change the lifecycle of the audio context (this is left to the consumer).

# Installation

# NPM

This package can be installed from NPM

```
npm i @speechmatics/web-pcm-player
```

# Import map

You can also fetch the code from UNPKG for use in an import map:

```html
<script type="importmap">
  {
    "imports": {
      "@speechmatics/web-pcm-player": "https://unpkg.com/@speechmatics/web-pcm-player@1.0.0-rc/dist/index.min.js"
    }
  }
</script>
```

# Usage

This library can be used to play PCM data from either an:
  - `Int16Array` for 16-bit unsigned integer PCM or
  - `Float32Array`. for 32-bit float PCM

These formats correspond to `pcm_s16le` and `pcm_f32le` respectively, as described in the [FFMPEG guide to PCM formats here](https://trac.ffmpeg.org/wiki/audio%20types#SampleFormats). If you'd like more PCM formats to be added, feel free to raise an issue.

## Base64 audio example

Below is an example usage playing `pcm_s16le` audio rendered as Base 64.

For a full working example, open the file `examples/example.html` in the browser.

```javascript
import { PCMPlayer } from "@speechmatics/web-pcm-player";

async function playTestAudio() {
  const audioContext = new AudioContext({ sampleRate: 16_000 });
  await audioContext.resume();
  const player = new PCMPlayer(audioContext);

  for (const audioChunk of base64Data) {
    const buffer = Uint8Array.from(atob(audioChunk), (c) =>
      c.charCodeAt(0)
    );
    const data = new Int16Array(buffer.buffer);
    player.playAudio(data);
  }
}

window.onload = () => {
  document.getElementById("play-button").addEventListener("click", () => {
    playTestAudio();
  });
};

const base64Data = [
  // See data in the examples/ folder
];
```