Ejemplo n.º 1
0
	def __init__(self,midiDevice,sampleRate):
		self._player=speechPlayer.SpeechPlayer(sampleRate)
		self._midiHandle=HMIDIIN()
		self._cMidiInProc=MidiInProc(self.midiInProc)
		windll.winmm.midiInOpen(byref(self._midiHandle),midiDevice,self._cMidiInProc,None,0x30000)
		windll.winmm.midiInStart(self._midiHandle)
		self._lastPhoneme=ipa.data[sys.argv[2]]
		ipa.applyPhonemeToFrame(frame,self._lastPhoneme)
Ejemplo n.º 2
0
 def __init__(self, midiDevice, sampleRate):
     self.curPatchNum = 0
     self._player = speechPlayer.SpeechPlayer(sampleRate)
     self._lavPlayer = LavPlayer(self._player, sampleRate)
     self._midiHandle = HMIDIIN()
     self._cMidiInProc = MidiInProc(self.midiInProc)
     windll.winmm.midiInOpen(byref(self._midiHandle), midiDevice,
                             self._cMidiInProc, None, 0x30000)
     windll.winmm.midiInStart(self._midiHandle)
Ejemplo n.º 3
0
 def __init__(self):
     if self.exposeExtraParams:
         self._extraParamNames = [x[0] for x in speechPlayer.Frame._fields_]
         self.supportedSettings = SynthDriver.supportedSettings + tuple(
             NumericSynthSetting("speechPlayer_%s" % x,
                                 "frame.%s" % x,
                                 normalStep=1,
                                 availableInSynthSettingsRing=False)
             for x in self._extraParamNames)
         for x in self._extraParamNames:
             setattr(self, "speechPlayer_%s" % x, 50)
     self.player = speechPlayer.SpeechPlayer(16000)
     _espeak.initialize()
     _espeak.setVoiceByLanguage('en')
     self.pitch = 50
     self.rate = 50
     self.volume = 90
     self.inflection = 60
     self.audioThread = AudioThread(self.player, 16000)
Ejemplo n.º 4
0
import ctypes
import sys
import codecs
import ipa
import time
import speechPlayer
from lavPlayer import LavPlayer

speed=1

player=speechPlayer.SpeechPlayer(22050)
lavPlayer=LavPlayer(player,22050)

frame=speechPlayer.Frame()
frame.outputGain=1.0
frame.preFormantGain=1.0
frame.vibratoPitchOffset=0.1
frame.vibratoSpeed=5.5
frame.voicePitch=150
ipa.setFrame(frame,'æ')
frame.voiceAmplitude=0
player.queueFrame(frame,120/speed,100/speed)
frame.voiceAmplitude=1
player.queueFrame(frame,120/speed,40/speed)
ipa.setFrame(frame,'n')
frame.voicePitch=100
player.queueFrame(frame,120/speed,40/speed)
ipa.setFrame(frame,'ɑ')
frame.voicePitch=90
player.queueFrame(frame,80/speed,40/speed)
player.queueFrame(None,40/speed,40/speed)
Ejemplo n.º 5
0
####
# Copyright 2013 Michael Curran <*****@*****.**>.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 2.1, as published by
# the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# This license can be found at:
# http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
####

import codecs
import time
import sys
import speechPlayer
import ipa

player = speechPlayer.SpeechPlayer(16000)
time.sleep(0.05)
text = codecs.open(sys.argv[1], 'r', 'utf8').read()
#text=text.replace(u'a',u'æ')
for line in text.splitlines():
    for args in ipa.generateFramesAndTiming(line.strip()):
        player.queueFrame(*args)
    player.queueFrame(None, 150, 0)
time.sleep(300)