Comments (19)
I've tried it, and it works. But I have found a bug: if you want the bot to play only one word, it doesn't; at least in Spanish, I don't know if the same thing happens in other languages.
This, works:
let voiceChannel = message.member.voice.channel;
voiceChannel.join().then(connection => {
const stream = discordTTS.getVoiceStream("me gusta el bizcocho", {lang:"es"});
const dispatcher = connection.play(stream);
dispatcher.on("finish",() => voiceChannel.leave());
});
This, doesn´t work:
let voiceChannel = message.member.voice.channel;
voiceChannel.join().then(connection => {
const stream = discordTTS.getVoiceStream("hola", {lang:"es"});
const dispatcher = connection.play(stream);
dispatcher.on("finish",() => voiceChannel.leave());
});
from discord-tts.
i will be taking a look at it ty
google now requires a recaptcha to get the sound stream not sure how to bypass that
from discord-tts.
I can confirm that this is still happening.
"discord-tts": "^1.2.0",
"discord.js": "^12.5.3",
node -v
v16.4.0
from discord-tts.
I have the same problem. 1 month ago, it works perfectly, but since 1 week, it doesnt play any sound
from discord-tts.
i will be taking a look at it ty
from discord-tts.
You have our full support. Hopefully you can solve it; it is a very useful resource that we all appreciate. Great job.
from discord-tts.
You have our full support. Hopefully you can solve it; it is a very useful resource that we all appreciate. Great job.
Update to new version 1.2. should be playing audio again :)
from discord-tts.
Hey @mundoex It's seams like that it's still isn't working
from discord-tts.
Hey @mundoex It's seams like that it's still isn't working
I tested it and it worked for me, are you getting any error or anything so i can try help?
from discord-tts.
Hey @mundoex It's seams like that it's still isn't working
I tested it and it worked for me, are you getting any error or anything so i can try help?
Works for me after the last update as well.
from discord-tts.
@mundoex Bot just joins the channel and doesn't play any sound. This is exactly the same behaviour as it was in 1.1
const languageCode = "en-US"
const connection = await message.member.voice.channel.join();
connection.play(discordTTS.getVoiceStream(text, languageCode), { volume: 6 })
.on('finish', () => connection.disconnect());
"@discordjs/opus": "^0.3.3",
"discord-tts": "^1.2.0",
"discord.js": "^12.3.1",
"ffmpeg-static": "^4.2.7",
from discord-tts.
give this a try
connection.play(discordTTS.getVoiceStream(text, { lang: languageCode }), { volume: 6 })
from discord-tts.
@mundoex That gave error
Error: lang "en-US" might not exist
at C:\***\node_modules\google-tts-api\dist\getAudioBase64.js:91:31
Which I fixed by changing it to en
. However it still don't play anything
from discord-tts.
@mundoex That gave error
Error: lang "en-US" might not exist at C:\***\node_modules\google-tts-api\dist\getAudioBase64.js:91:31
Which I fixed by changing it to
en
. However it still don't play anything
try with just "en"
from discord-tts.
@mundoex That gave error
Error: lang "en-US" might not exist at C:\***\node_modules\google-tts-api\dist\getAudioBase64.js:91:31
Which I fixed by changing it to
en
. However it still don't play anything
would it be ok if i added you on discord to try and help?
from discord-tts.
@mundoex I just ran I today and it started working, not sure what caused it. Anyways, thanks for the help!
from discord-tts.
I have the same problem, doesn't play any sound.
let voiceChannel = message.member.voice.channel;
voiceChannel.join().then(connection => {
const stream = discordTTS.getVoiceStream("hola, estoy probando", "es-ES");
const dispatcher = connection.play(stream);
dispatcher.on("finish",() => voiceChannel.leave());
});
And I have the last version (1.2.0)
from discord-tts.
I have the same problem, doesn't play any sound.
let voiceChannel = message.member.voice.channel; voiceChannel.join().then(connection => { const stream = discordTTS.getVoiceStream("hola, estoy probando", {lang:"es"}); const dispatcher = connection.play(stream); dispatcher.on("finish",() => voiceChannel.leave()); });And I have the last version (1.2.0)
I have the same problem, doesn't play any sound.
let voiceChannel = message.member.voice.channel; voiceChannel.join().then(connection => { const stream = discordTTS.getVoiceStream("hola, estoy probando", "es-ES"); const dispatcher = connection.play(stream); dispatcher.on("finish",() => voiceChannel.leave()); });And I have the last version (1.2.0)
const stream = discordTTS.getVoiceStream("hola, estoy probando", {lang:"es"});
from discord-tts.
I've tried it, and it works. But I have found a bug: if you want the bot to play only one word, it doesn't; at least in Spanish, I don't know if the same thing happens in other languages.
This, works:
let voiceChannel = message.member.voice.channel; voiceChannel.join().then(connection => { const stream = discordTTS.getVoiceStream("me gusta el bizcocho", {lang:"es"}); const dispatcher = connection.play(stream); dispatcher.on("finish",() => voiceChannel.leave()); });This, doesn´t work:
let voiceChannel = message.member.voice.channel; voiceChannel.join().then(connection => { const stream = discordTTS.getVoiceStream("hola", {lang:"es"}); const dispatcher = connection.play(stream); dispatcher.on("finish",() => voiceChannel.leave()); });
I was able to workaround the cut off, see: #19 (comment)
from discord-tts.
Related Issues (19)
- Client leave the voice channel after tts is done. HOT 7
- FFmpeg/avconv not found! HOT 1
- dispatcher.on("finish") do not triggers HOT 4
- Possible to change TTS speed? HOT 1
- Dispatcher "finish" event not working. HOT 1
- Finish event gets thrown before anything is said HOT 2
- Option to change voice gender and cooldown between words HOT 1
- is the package will run in discord.js v13 HOT 2
- TTS Gets cut off early HOT 3
- (node:21888) UnhandledPromiseRejectionWarning: TypeError: connection.play is not a function HOT 1
- the client.voice.createBroadcast() is not a function
- Play long messages? HOT 2
- discordTTS doesn't work with single words
- Get error when the length of the string is more than 200 HOT 1
- The "listener" argument must be of type function. Received undefined
- When i try it in a private hosting (container) the language doesn't change
- Get key failed from google HOT 8
- Unhandled promise rejection: Error: get token key failed from google HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-tts.