From 6c597b4f7843c76b27431398acc772ee27f52e23 Mon Sep 17 00:00:00 2001 From: urioxis Date: Thu, 10 Feb 2011 14:54:12 +0000 Subject: [PATCH] esd sort of working --- src/contrib/esdout/EsdOut.cpp | 10 ++++++++-- src/contrib/esdout/EsdOutBuffer.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/contrib/esdout/EsdOut.cpp b/src/contrib/esdout/EsdOut.cpp index 827d107f1..896a03eb0 100644 --- a/src/contrib/esdout/EsdOut.cpp +++ b/src/contrib/esdout/EsdOut.cpp @@ -235,8 +235,14 @@ void EsdOut::SetFormat(IBuffer *buffer){ this->waveFormat |= ESD_STREAM; this->waveFormat |= ESD_PLAY; - - this->waveHandle = esd_play_stream(this->waveFormat, (int)this->currentSampleRate, "192.168.10.1:16001", "musik"); +#ifdef _DEBUG + std::cerr << "waveFormat: " << this->waveFormat << std::endl; +#endif + char* host = getenv("ESPEAKER"); +#ifdef _DEBUG + std::cerr << "host: " << host << std::endl; +#endif + this->waveHandle = esd_play_stream(this->waveFormat, (int)this->currentSampleRate, host, "musik"); #ifdef _DEBUG std::cerr << "waveHandle: " << this->waveHandle << std::endl; #endif diff --git a/src/contrib/esdout/EsdOutBuffer.cpp b/src/contrib/esdout/EsdOutBuffer.cpp index 7a83e0f5e..700f894e0 100644 --- a/src/contrib/esdout/EsdOutBuffer.cpp +++ b/src/contrib/esdout/EsdOutBuffer.cpp @@ -102,7 +102,7 @@ bool EsdOutBuffer::AddToOutput(){ printf("Short write (expected %li, wrote %li)\n", (long)bufferLength, frames); return false; }*/ - if ( write( *wHandle, *data, bufferLength ) <= 0 ) + if ( write( *wHandle, data, bufferLength ) <= 0 ) return false; return true; }