Gtts Male Voice Best Online
engine.say("Hello, I am a male voice using pyttsx3") engine.runAndWait()
On Windows, David (male) is usually available. On macOS, use 'com.apple.speech.synthesis.voice.vegas' (male). If you need professional male voices (like en-US-Neural2-D or en-GB-Neural2-B ), use Google Cloud Text-to-Speech — but not the free gtts . gtts male voice
from google.cloud import texttospeech client = texttospeech.TextToSpeechClient() synthesis_input = texttospeech.SynthesisInput(text="Hello, I am a male voice") voice = texttospeech.VoiceSelectionParams( language_code="en-US", name="en-US-Neural2-D", # Male voice ssml_gender=texttospeech.SsmlVoiceGender.MALE ) audio_config = texttospeech.AudioConfig(audio_encoding=texttospeech.AudioEncoding.MP3) response = client.synthesize_speech(input=synthesis_input, voice=voice, audio_config=audio_config) engine
# Load audio audio = AudioSegment.from_file(fp, format="mp3") from google
from gtts import gTTS tts = gTTS(text="Hello", lang="en") # always the default voice (female) The only reliable way is to switch to a different TTS engine or post-process the audio (pitch shifting). Here’s a clean Python approach using pydub to lower the pitch of the GTTS output, making it sound more masculine. Step-by-step male voice transformation: from gtts import gTTS from pydub import AudioSegment from pydub.effects import speedup import io def gtts_male_voice(text, lang='en', pitch_semi= -3): # Generate normal GTTS audio tts = gTTS(text, lang=lang) fp = io.BytesIO() tts.write_to_fp(fp) fp.seek(0)
import pyttsx3 engine = pyttsx3.init() voices = engine.getProperty('voices') for v in voices: print(v.id, v.name, v.gender) # Some show gender Pick a male voice (e.g., 'HKEY_LOCAL_MACHINE\SOFTWARE...' on Windows) for v in voices: if 'male' in v.name.lower(): engine.setProperty('voice', v.id) break