• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    C
  • License
    Other
  • Created over 12 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

C library for speech recognition using the Google Speech API

Libsprec

Speech recognizer library in C using the Google Speech v2.0 API.

Requires libcurl >= 7.25.0, libflac and libogg.

For iOS, you have to grab these libraries either from Cydia or my web page. Libflac, libogg and libcurl should be already in your favourite Unix distro's package management system (OS X and Homebrew are no exception!).

For iOS, you can download the Debian packages from here:

Tested on iOS 4.2.1, Ubuntu 11.10 and OS X 10.9.5.

If immediate recording of FLAC audio is possible on a platform, then it should be done using 16000 samples/second, 2 channels, 16 bit/sample (signed little endian); and only the functions in web_client.h have to be used, e. g.:

  • sprec_send_audio_data() takes a pointer to the contents of a FLAC file and sends it to the Google Speech API along with the appropriate headers and other parameters. Returns the server's response.

If immediate FLAC recording is not available, then the audio should be recorded in WAV (uncompressed interleaved PCM), 16 bits/sample, signed, little endian, 2 channels and 16000 Hz sample rate). Then the resulting WAV file should be converted to a FLAC one using sprec_flac_encode() from flac_encoder.h. Then one can proceed as described above. You can use the sprec_record_wav() function for recording in the appropriate format.

The simple API

To simplify this task, two convenience functions, sprec_recognize_sync() and sprec_recognize_async() are also available (the latter needs POSIX threads).

See examples/simple.c for further API usage information.

The usage of the example program is:

./simple <API key> <language code> <duration>

A word about API keys

The Google Speech v2.0 API requires an API key, and rate-limits the application to 50 keys per day. In order to obtain an API key, follow the instructions at http://www.chromium.org/developers/how-tos/api-keys, except that you don't have to make an OAuth key (a browser/server/iOS app key under the tab "Public API Access" does the job just as well).

Response format

Some people complained that libsprec depends on my libjsonz library. I've thus removed the dependency. I tried to use yajl instead, but Google's JSON response is in a very, um, particular format (it's sometimes two JSON objects separated by a newline), and yajl doesn't seem to be able to digest it. So libsprec now just spits out verbatim the JSON it has got, and it's the developer's responsibility to make sense of it.

More Repositories

1

Sparkling

Lightweight extension language
C
230
star
2

RSSKit

iOS framework to make development of RSS reader apps easier.
Objective-C
131
star
3

HCDownload

Drop-in download manager view controller for iOS
Objective-C
117
star
4

avocado

Strongly-typed MongoDB driver for Rust
Rust
80
star
5

Unbox

Access the whole filesystem from sandboxed applications!
Objective-C
68
star
6

parsel

Generate parsers directly from AST node types
Rust
65
star
7

abevjava-docker

ÁNYK/ABEVJAVA Docker image, so that you don't have to.
Dockerfile
34
star
8

NSString-MD5

Add convenience MD5 methods to NSString class
Objective-C
30
star
9

libipodimport

Damn simple iPod import support library
Objective-C
25
star
10

VocalKit

Brian King's VocalKit for voice recognition for iOS devices - redesigned, stripped, better
C
22
star
11

libavrutil

Easy to use, lightweight and unified library for performing common microcontroller tasks
C
21
star
12

hash_table

Fast, data-oriented, stdlib-style hash table
C++
21
star
13

MyFile

Free & opensource file manager for iOS, now again opensource
Objective-C
21
star
14

TCPHelper

Simple one-connection TCP server/client C functions (synchronous) and Objective-C class (asynchronous)
Objective-C
19
star
15

x-webkit-speech

Enables Chrome's "x-webkit-speech" input attribute in MobileSafari
Objective-C
17
star
16

MFMusicLibrary

iPhone framework to access the iPod library
Objective-C
17
star
17

magnet

A JSON/BSON schema generator
Rust
16
star
18

BingTranslate

Objective-C client library for the Microsoft (R) Translator APIs
Objective-C
15
star
19

UIImage-Editor

Convenience category for UIImage for manipulating it as in a simple image editor
Objective-C
13
star
20

PwnTube

Opensource almost-clone implementation of YourTube and Gremlin
Objective-C
12
star
21

libgpod-ondevice

iPhone port of libgpod 0.8.2, now with corrected to run itdb postprocess commands properly.
C
12
star
22

libjsonz

A not-so-strict, lightweight JSON parsing library
C
11
star
23

LinenAlert

Linen-backgrounded alert views and modernized notifications for iOS - concept created by Verge user Sentry
Objective-C
11
star
24

FileTransfer

File exchange for iOS devices made easy
Objective-C
9
star
25

Untree

Parsing images of binary trees to structured data — an experiment in computer vision
C++
7
star
26

HCYouTube

Obtain direct links to YouTube-videos
Objective-C
7
star
27

CNNSim

Tiny, crude CNN simulator
C++
6
star
28

SQLHelper

Object-oriented convenience wrapper around the procedural sqlite3 API
Objective-C
6
star
29

dyn_ord

Traits for dynamically-typed equality comparison and ordering
Rust
6
star
30

ios-toolchain

Opensource iOS toolchain for 32 and 64 bit Linux -- build instructions
6
star
31

XSPFKit

Objective-C framework to support the XSPF playlist format.
Objective-C
5
star
32

Shortener

Quick URL shortener hack for NSURL using the Bitly API
Objective-C
5
star
33

option_set

Bitflags on steroids
Rust
5
star
34

mfpluginapi

API documentation and sample code for devs wanting to make MyFile plug-ins
Objective-C
5
star
35

mdccc

Markdown Compiler-Compiler-Compiler
Rust
5
star
36

Cereal

Siri-like behaviour on old iOS devices using Dragon Dictation
Objective-C
5
star
37

MPOAuthiOS

Improved fork of MPOAuth
Objective-C
4
star
38

ViewSourceSafari

"View page source" functionality for MobileSafari
Objective-C
4
star
39

FullDrop

Unofficial, but fully-featured and free Dropbox client for iOS.
Objective-C
4
star
40

PrivSymPoke

Access and dump private symbols of Mach-O files
C
4
star
41

Self-Driving-Cars-Workshop

My implementation of https://www.meetup.com/Onjaro-Autokat-Budapesten-Self-Driving-Cars-in-Budapest/
C++
4
star
42

NPSwift

Code accompanying my talk "Non-Pessimizations in the Swift Compiler"
Swift
4
star
43

sdl2-sparkling

SDL2 bindings for Sparkling
C
3
star
44

PWSearch

A local, (t)rusty search tool for checking compromised passwords
Rust
3
star
45

Metronome

Simple metronome app for iOS
Objective-C
3
star
46

serialtool

Little helper functions to make serial port communication obvious
C
3
star
47

zstr

Rust
3
star
48

libzbar-ios

iOS build of libzbar
C
3
star
49

mandelrs

Optimized, parallel Mandelbrot set solver in Rust
Rust
3
star
50

Plist2ObjC

Objective-C literals from property lists
Objective-C
3
star
51

SparklingKit

Objective-C wrapper around the Sparkling API
Objective-C
3
star
52

HCJSON

Easy-to-use, lightweight JSON parser and generator in Objective-C.
Objective-C
3
star
53

steelsafe

Pure Rust, no-unsafe, TUI password manager
Rust
2
star
54

rust-map-merge-benchmark

https://users.rust-lang.org/t/merging-elements-in-btreemap
Rust
2
star
55

SQLite3-Sparkling

Minimalistic SQLite3 bindings for Sparkling.
C
2
star
56

CodeLock

Basic code lock circuitry using an Arduino
C
2
star
57

ExplainIt

Inline translator for MobileSafari
Objective-C
2
star
58

Advent-Of-Code-2017

My solutions to the Advent of Code 2017, in Rust.
Rust
2
star
59

ring_api

Strongly-typed Rust client for the RING HTTP API
Rust
2
star
60

database_dsl_complexity

Material for the original research paper "Query Complexity in Modern Database DSLs"
HTML
2
star
61

libavrutilpp

Easy to use, lightweight and unified C++ library for performing common microcontroller tasks. Built around libavrutil.
C++
2
star
62

PodMail

Email songs/videos directly from iPod!
Objective-C
2
star
63

iPodMemos

Add to iPod button for VoiceMemos app
Objective-C
2
star
64

Fridge

Free app to add media to the iOS (iPod) media library
Objective-C
2
star
65

YAOLNP

Yet Another One-Line Node Package
JavaScript
1
star
66

is_variant

proc-macro derive for quickly checking if an enum contains a certain variant
Rust
1
star
67

Lambda

Doing homework for fun, from a class I don't attend, because I like compilers
C++
1
star
68

sudoku

https://www.youtube.com/watch?v=DmT80OseAGs but in Rust
Rust
1
star
69

rust-cxx-interop

Example code for very basic Rust-C++ interop
Rust
1
star
70

MScThesis

My Master's Thesis in Data Science at Università degli Studi di Padova
1
star
71

dev-sigh

/dev/sigh, just for fun
C
1
star
72

libblock

Use blocks with unsupported old GCC versions
Objective-C
1
star
73

BScThesis

Material for my Bachelor's Thesis
C
1
star
74

Deletrack

Delete music&videos right from iPod.app!
Objective-C
1
star
75

AdventOfCode-2015

My solutions to the Advent of Code
Haskell
1
star
76

spiritgui

GTK+-based GUI for Spirit Jailbreak
C
1
star
77

genfiles

Generate class header and implementation file templates quickly for (OO) C, C++, Objective-C, Objective-C++
Shell
1
star
78

NonogramSolver

Our university project in Programming 2.
Objective-C++
1
star