0

I want to run a Python3 script with a text to speach engine called pyttsx3 to read some text via bluetooth.Unfortunally it does´t work.
So what I have done is this:
First I have setted up a new Raspbian Image (newest Version: Stretch)
Then I´ve installed all dependencies via pip3 and apt-get
Then I tried to run sudo bluetoothctl and pair, trust and connect but I got an alsa error. That I have fixed with sudo apt-get install bluealsa.
After Rebooting and restarting and paring usw. I tried to run my script with sudo.
I get this error: enter image description here So then I have read in a forum how to fix it.
Then after fixing that (without the jackd2 installation, that doesn´t work) I ran the script againe and this happend: enter image description here So I have googled some time and thought to run it with pulseaudio.
So I ran sudo apt-get install pulseaudio pulseaudio-module-bluetooh.
After that I reboot the system removed my device and reconnected it, then I tried to run the script againe and get the same error, so after figuring out that I have to run pulseaudio --start I have done this run the script againe and get another error... . sudo pulseaudio -v and now I have seen more detailed information so I tried to connect my device againe and it works (the connection).
After that I ran the script againe and no errors have showed up, yeay.
But no sound, so I ran sudo bluetoothctland I saw that the bluetooth device connected after I run that command and could see it. So I googled againe and found that. (the second last but one post with the link) I configure it as they wrote it there.
And againe I ran it and no sound so I looked at the output form sudo pulseaudio -v and figured out that the pi tried to pipe the output to a output called alsa_output.platform-soc_audio.analog-stereo but there is no analog audio card on the Pi (or am I wrong).
So and after this I googled a lot and ask a question here aswell and now this one because I can´t figure it out what to do. Because sometimes it connects and you can see via pactl list cards (but this happends only 2 times and I don´t know why) and via sudo pulseaudio -v but still no sound. So I would recommend you to check my older question (the comments are very important) too because they recommend something aswell and this I have tried too. (I created a bunch of testing Images). So I hope everthing important is here, if you still need something simply ask me. EDIT: I tried this this today (17.01) and it worked on my Pi 3, so maybe it`s possible to run it on the Pi Zero W too (in headless mode).

  • Are you trying to create a bluetooth speaker? – arjun Dec 3 '17 at 13:50
  • @arjun I want some Sound output generated by a Python script using pyttsx send through some Bluetooth Headset, Box or something Else. ( so you can hear it) – Flajt Dec 3 '17 at 13:57
  • You can first try to setup your pi as a dedicated bluetooth transmitter. There are many tutorials which cover that.- raspberrypi.org/magpi/bluetooth-audio-raspberry-pi-3 – arjun Dec 3 '17 at 14:09
  • @arjun is it working for pi zero w aswell? – Flajt Dec 3 '17 at 14:12
  • why dont you try it. – arjun Dec 3 '17 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.