Uncategorized

eSpeak on macox 10.8.5 x86_64

1) Download portAudio: http://portaudio.com/docs/v19-doxydocs/compile_mac_coreaudio.html and extract to /portaudio and espeak: http://espeak.sourceforge.net/test/espeak-1.48.10a.zip and extract to /espeak-1.48.04-source/

2) go to /portaudio/src folder and simply use the Unix-style ./configure && make install

3) replace /portaudio/src/portaudio.h by your just compiled include/portaudio.h

4) try to from /espeak-1.48.04-source/src/ run “sudo make install” it will trow error:

event.cpp:413:16: error: use of undeclared identifier 'sem_timedwait'
while ((err = sem_timedwait(&my_sem_stop_is_required, &ts)) == -1


fifo.cpp:315:17: error: use of undeclared identifier 'sem_timedwait'
while ((err = sem_timedwait(&my_sem_start_is_required, &ts)) == -1

so change the lines with error to use macos compactible sem_wait instead

SHOW("fifo > sleep_until_start_request_or_inactivity > start sem_wait (start_is_required) from %d.%09lu to %d.%09lu \n",
to.tv_sec, to.tv_nsec,
ts.tv_sec, ts.tv_nsec);

while ((err = sem_wait(&my_sem_start_is_required)) == -1
&& errno == EINTR)
{
continue;
}


SHOW("polling_thread > sleep_until_timeout_or_stop_request > start sem_wait from %d.%09lu to %d.%09lu \n",
to.tv_sec, to.tv_nsec,
ts.tv_sec, ts.tv_nsec);

while ((err = sem_wait(&my_sem_stop_is_required)) == -1
&& errno == EINTR)
{
continue; // Restart when interrupted by handler
}

5) if you try to from espeak-1.48.04-source/src/ run make install again it will run no errors, but when trying to run eSpeak it will trow error:


Assertion failed: (-1 != sem_init(&my_sem_start_is_required, 0, 0)), function event_init, file event.cpp, line 96.

Resolve this by removing this assertions from espeak-1.48.04-source/src/event.cpp, line 96.


assert(-1 != sem_init(&my_sem_start_is_required, 0, 0));
assert(-1 != sem_init(&my_sem_stop_is_required, 0, 0));
assert(-1 != sem_init(&my_sem_stop_is_acknowledged, 0, 0));

6) if you try to from espeak-1.48.04-source/src/ run make install again it will run no errors, but when trying to run eSpeak it will trow error:


Assertion failed: (-1 != sem_init(&my_sem_start_is_required, 0, 0)), function fifo_init, file fifo.cpp, line 82.
Abort trap: 6

Resolve this by removing this assertions from espeak-1.48.04-source/src/fifo.cpp, line 82.

assert(-1 != sem_init(&my_sem_start_is_required, 0, 0));
assert(-1 != sem_init(&my_sem_stop_is_acknowledged, 0, 0));

7) from espeak-1.48.04-source/src/ run make install again and it should run no errors. I’ve tested on a osx 10.8.5 with xcode Version 5.1.1.

8) now you can hear text from your command line:
espeak espeak-owns

Enjoy talking to your mac 😉

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s