Coder Social home page Coder Social logo

speech-to-flac's Introduction

speech-to-flac

Example for client-side encoding microphone audio into FLAC.

This is a demo for JavaScript FLAC encoder libflac.js.

Similar to the Speech-To-File demo, this demo records audio from the microphone and encodes it into FLAC data. The Speech-To-File demo is based on A. Krennmair's Speech-To-Server demo.

When recording is stopped, a download link for the encoded data is triggered.

Encoding etc. works completely client-side, i.e. no data is sent to any server.

As a special option, the FLAC data can be sent to the Google Speech Recognition web service. NOTE that you need to set your (secret) API key for the recognition service first (see comment in app.js for more details).

Demo

Try out at the demo page.

Setup:

  • your device needs a microphone
  • accept, when asked to allow your browser access to the microphone

Setup Speech Recognition (Google Cloud Speech service):

  • you can set the API key / service key via search params in the URL:
    • key: key=<your key>
    • use API key: auth=apiKey
    • use service key: auth=serviceKey (default method)
      • see also the node utility script create_access_token.js
      • NOTE currently, the serviceKey option does work in normal browser environments due to CORS/authentification limitations
  • pre-selected recognition language: language=de-DE
  • examples (append to URL):
    • (access token from service key) ?language=en-GB&key=<access token generated with a service key>
    • (API key, only use in secure env.) ?language=en-GB&auth=apiKey&key=<your API key>
  • NOTE: use the apiKey method for setting the auth/keys only for testing in secure environments & take care to keep your keys secret!!!
    Instead you should set up a service that allows logged in users to retrieve an access token, generated with your service key on your secured server
    (see the examle script create_access_token.js for an example to generate the access token on your server using Node.js)

Usage:

  • select FLAC-file for encoding the audio in FLAC format (or WAV for uncompressed audio)
  • press Start recording will start recording (you may need to allow your browser access to your microphone in this step)
  • pressing Stop recording will open a dialog for downloading the recorded file (FLAC or WAV)
  • note: recording & encoding to FLAC is done all on the client-side (i.e. within your browser); no data is sent to a server.

NOTE: If you access the demo page via https, most browsers will make the permission for accessing your microphone from this page persistent; if accessed via http the permission only lasts until you leave the page (or may even deny access to the microphone altogether).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.