Commit 09ac5653 authored by Jonas Stienen's avatar Jonas Stienen
Browse files

Finishing bare implementation of TTS signal source, now takes arguments and...

Finishing bare implementation of TTS signal source, now takes arguments and returns parameters, but does not do anything with it.
parent 697e5661
......@@ -11,7 +11,7 @@
#include "VASequencerSignalSource.h"
#include "VAEngineSignalSource.h"
#include "VAMachineSignalSource.h"
//#include "VATextToSpeechSignalSource.h"
#include "VATextToSpeechSignalSource.h"
#include <ITAException.h>
#include <ITAStringUtils.h>
......@@ -227,12 +227,9 @@ std::string CVAAudioSignalSourceManager::CreateAudiofileSignalSource( const std:
std::string CVAAudioSignalSourceManager::CreateTextToSpeechSignalSource( const std::string& sName )
{
VA_EXCEPT2( NOT_IMPLEMENTED, "TTS signal sources are not implemented yet, rejected to create source ''" + sName + "'" );
/*
// TTS signals are always dynamic and managed
CVATextToSpeechSignalSource* pSource = new CVATextToSpeechSignalSource( m_dSamplerate, m_iBlocklength );
return RegisterSignalSource( pSource, sName, true, true );
*/
}
std::string CVAAudioSignalSourceManager::CreateSequencerSignalSource( const std::string& sName )
......
......@@ -12,9 +12,8 @@
#include <assert.h>
#include <math.h>
CVATextToSpeechSignalSource::CVATextToSpeechSignalSource( const CVATextToSpeechSignalSource::Config& oConfig )
: ITADatasourceRealization( 1, oConfig.pCore->GetCoreConfig()->oAudioDriverConfig.dSampleRate, oConfig.pCore->GetCoreConfig()->oAudioDriverConfig.iBuffersize )
, m_oConfig( oConfig )
CVATextToSpeechSignalSource::CVATextToSpeechSignalSource( const double dSampleRate, const int iBlockLength )
: ITADatasourceRealization( 1, dSampleRate, (unsigned int)( iBlockLength ) )
, m_pAssociatedCore( NULL )
{
m_sbOut.Init( GetBlocklength(), true );
......@@ -31,7 +30,7 @@ int CVATextToSpeechSignalSource::GetType() const
std::string CVATextToSpeechSignalSource::GetTypeString() const
{
return "text-to-speech";
return "tts";
}
std::string CVATextToSpeechSignalSource::GetDesc() const
......@@ -41,11 +40,15 @@ std::string CVATextToSpeechSignalSource::GetDesc() const
IVACore* CVATextToSpeechSignalSource::GetAssociatedCore() const
{
return m_oConfig.pCore;
return m_pAssociatedCore;
}
const float* CVATextToSpeechSignalSource::GetStreamBlock( const CVAAudiostreamState* pStreamInfo )
{
// This is the live update function that is called by the audio streaming.
// We will deilver either zeros for a quit talker, or take speech samples from
// the WAv file or internal sample buffer.
m_sbOut.Zero();
// @todo: take samples from generated WAV file
......
......@@ -13,30 +13,12 @@ class CVACoreImpl;
/** Text-to-speech signal source
*
* The TTS signal source generates sound from text using external libraries, like TTSRelay for Windows platforms.
*
*/
class CVATextToSpeechSignalSource : public IVAAudioSignalSource, public ITADatasourceRealization
{
public:
class Config
{
public:
CVACoreImpl* pCore;
Config( CVACoreImpl* pCore ) : pCore( pCore )
{
SetDefaults();
};
virtual void SetDefaults()
{
}
private:
Config();
};
CVATextToSpeechSignalSource( const Config& );
CVATextToSpeechSignalSource( const double dSampleRate, const int iBlockLength );
virtual ~CVATextToSpeechSignalSource();
int GetType() const;
......@@ -52,9 +34,7 @@ public:
void Reset();
private:
IVACore* m_pAssociatedCore;
Config m_oConfig;
ITASampleBuffer m_sbOut;
};
......
......@@ -21,6 +21,8 @@ set( DirFiles
VANetworkStreamAudioSignalSource.cpp
VASequencerSignalSource.cpp
VASequencerSignalSource.h
VATextToSpeechSignalSource.h
VATextToSpeechSignalSource.cpp
_SourceFiles.cmake
)
set( DirFiles_SourceGroup "${RelativeSourceGroup}" )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment