Popularity
3.4
Declining
Activity
0.0
Stable
8
2
0
Monthly Downloads: 1
Programming language: Haskell
License: MIT License
Latest version: v0.0.0.1
network-voicetext alternatives and similar packages
Based on the "network" category.
Alternatively, view network-voicetext alternatives based on common mentions on social networks and blogs.
-
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
javascript-bridge
Bridge to JavaScript on the browser -
resolv
Domain Name Service (DNS) lookup via the libresolv standard library routines -
dmcc
Haskell bindings for AVAYA DMCC API and WebSockets server for AVAYA -
nakadi-client
Haskell Client Library for the Nakadi Event Broker -
network-address
IP data structures and textual representation -
network-data
Network data structures in Haskell (IP, UDP, TCP headers, etc) -
network-uri-json
FromJSON and ToJSON Instances for Network.URI -
windns
Domain Name Service (DNS) lookup via the Windows dnsapi standard library -
hatexmpp3
XMPP client with synthetic filesystem (9P) and (optional) graphical (GTK3) interfaces -
hsendxmpp
sendxmpp clone and drop-in replacement, sending XMPP messages via CLI -
LDAPv3
Lightweight Directory Access Protocol V3 (LDAPv3) RFC4511 implementation -
transient-universe-tls
Secure communications for transient-universe -
iwlib
A binding to the iw library for getting info about the current WiFi connection. -
network-uri-lenses
lenses for http://hackage.haskell.org/package/network-uri -
oauth2-jwt-bearer
OAuth2 jwt-bearer client flow as per rfc7523. -
network-simple-wss
Simple Haskell interface to TLS secured WebSockets -
attoparsec-uri
A compositional URI parser / printer for attoparsec -
percent-encoder
A simple, fast percent encoder/decoder for bytestrings -
google-oauth2-easy
📛 Easy Google Authentication integration - Authorization Code & Refresh Token
Tired of breaking your main and manually rebasing outdated pull requests?
Managing outdated pull requests is time-consuming. Mergify's Merge Queue automates your pull request management & merging. It's fully integrated to GitHub & coordinated with any CI. Start focusing on code. Try Mergify for free.
Promo
blog.mergify.com
Do you think we are missing an alternative of network-voicetext or a related project?
README
Network.VoiceText
VoiceText Web API Haskell wrapper library
Usage
Create Basic Auth Information
basicAuth "basic_auth_username" ""
Create TTS Parameter
Set only the required items.
ttsParams "Hello, world." Show
Set the all items.
addVolume 120 $
addSpeed 150 $
addPitch 50 $
addEmotionLevel 2 $
addEmotion Happiness $
addFormat Ogg $
ttsParams "こんにちは" Takeru
Send the request
Create sound file.
call ttsToFile
.
import Network.VoiceText
main = do
let b = basicAuth "basic_auth_username" ""
let p = ttsParams "Hello, world." Show
ttsToFile "./test.wav" b p
Use response data to another way.
call tts
, and use response Data.ByteString.Lazy.Internal.ByteString
data.
import Network.VoiceText
main = do
let b = basicAuth "basic_auth_username" ""
let p = ttsParams "Hello, world." Show
bytes <- tts b p
print bytes
For example, play the voice data using Sound.ALUT.
- stack.yaml
resolver: lts-2.22
packages:
- location: .
- location:
git: https://github.com/zaneli/network-voicetext.git
commit: 54ce62af6c4decb023a36a39c081d0411c8cc11d
extra-dep: true
extra-deps:
- ALUT-2.4.0.2
- OpenAL-1.7.0.4
- example.cabal
library
build-depends: base >=4.6 && <4.8
, network-voicetext >=0.0
, bytestring >=0.10
, word8 >=0.1
, OpenAL >=1.6
, ALUT >=2.3
import Network.VoiceText
import Sound.ALUT
import Data.Word8
import Data.ByteString.Internal (toForeignPtr)
import Data.ByteString.Lazy (toStrict)
import Foreign.ForeignPtr (withForeignPtr)
import System.Environment (getArgs)
import qualified Foreign.C.Types as CT
import qualified Sound.OpenAL.AL.Buffer as AL
main = do
mr <- createVoice
playVoice mr
createVoice :: IO (AL.MemoryRegion Word8)
createVoice = do
[message] <- getArgs
(Right bytes) <- tts (basicAuth "basic_auth_username" "") (ttsParams message Show)
let (fptrw, _, ptrLength) = toForeignPtr $ toStrict bytes
withForeignPtr fptrw $ \ptr -> do
let size = CT.CInt $ fromIntegral ptrLength
return $ AL.MemoryRegion ptr size
playVoice :: AL.MemoryRegion a -> IO ()
playVoice mr = withProgNameAndArgs runALUTUsingCurrentContext $ \_ _ -> do
(Just device) <- openDevice Nothing
context <- createContext device []
currentContext $= context
buffer <- createBuffer $ FileImage mr
[source] <- genObjectNames 1
queueBuffers source [buffer]
play [source]
sleep 1
closeDevice device
return ()