I’m trying to do something stupid and make Mycroft discord compatible. Essentially what i want to do is make it use the discord API as I/O instead of a speaker/ microphone. But i don’t know where to look to find where this code is processed. Does anyone have any idea where to start?
I’ve never really done something like this before and i know im biting off more than i can chew but that honestly makes it kinda exciting for me. my plan is to use discord’s bot API but in the future i might expand the scope of the project so that it’s easier for other people to use. who knows maybe i’ll even make some skills for discord server moderation or something.
Hi there @folander , first of all a warm welcome!
Start here for the listener
functions;
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import time
from threading import Thread
import sys
import speech_recognition as sr
from pyee import EventEmitter
from requests import RequestException, HTTPError
This file has been truncated. show original
and start here for the microphone
functions;
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import audioop
from time import sleep, time as get_time
import collections
import datetime
import json
This file has been truncated. show original
and here for the text to speech functionality - ie playback;
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import sys
import io
from math import ceil
from mycroft.tts import TTS
This file has been truncated. show original
(I’ve made an assumption that you’re fairly technical, let us know if you’d like me to start at a different point)
Best, Kathy