Popularity
3.8
Declining
Activity
0.0
Stable
8
2
0
Monthly Downloads: 3
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 -
dmcc
Haskell bindings for AVAYA DMCC API and WebSockets server for AVAYA -
nakadi-client
Haskell Client Library for the Nakadi Event Broker -
resolv
Domain Name Service (DNS) lookup via the libresolv standard library routines -
network-address
IP data structures and textual representation -
network-data
Network data structures in Haskell (IP, UDP, TCP headers, etc) -
windns
Domain Name Service (DNS) lookup via the Windows dnsapi standard library -
network-uri-json
FromJSON and ToJSON Instances for Network.URI -
hatexmpp3
XMPP client with synthetic filesystem (9P) and (optional) graphical (GTK3) interfaces -
LDAPv3
Lightweight Directory Access Protocol V3 (LDAPv3) RFC4511 implementation -
hsendxmpp
sendxmpp clone and drop-in replacement, sending XMPP messages via CLI -
transient-universe-tls
Secure communications for transient-universe -
oauth2-jwt-bearer
OAuth2 jwt-bearer client flow as per rfc7523. -
iwlib
A binding to the iw library for getting info about the current WiFi connection. -
attoparsec-uri
A compositional URI parser / printer for attoparsec -
network-uri-lenses
lenses for http://hackage.haskell.org/package/network-uri -
network-simple-wss
Simple Haskell interface to TLS secured WebSockets -
google-oauth2-easy
📛 Easy Google Authentication integration - Authorization Code & Refresh Token -
postmark-streams
Send email via Postmark using io-streams
Static code analysis for 29 languages.
Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Promo
www.sonarqube.org
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 ()