concluder

package module
v0.0.0-...-18b85c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

README

Meeting Concluder Build status

This application can record and then summarize meetings automatically. An advice is added at the end of the summary, which can then (optionally) be sent to a Slack channel of your choosing.

Created in connection with the 2023 Hackdays.

Screenshot

screenshot of recording in progress

Getting started

  • Install the required dependencies (portaudio, ffmpeg and Go 1.16 or later).
  • Configure your Slack web hook URL either as the SLACK_EBHOOK_URL environment variable, or as slack_webhook = "YOUR SLACK WEBHOOK URL GOES HERE" in ~/.config/concluder.toml.
  • Configure your OpenAI API Key either as the OPENAI_API_KEY or OPENAI_KEY environment variable, or as openai_api_key = "YOUR KEY GOES HERE" in ~/.config/concluder.toml.
  • Make sure that you have a working microphone.

Clone the repository and run the server (which includes a frontend):

git clone https://github.com/schibsted/meeting-concluder.git
cd meeting-concluder/cmd/backend/backend
go build
./backend

Then visit http://localhost:3000.

A double clap can be used to stop the recording.

Note that the current maximum audio file size for the transcription API is 25 MiB, which is not a lot! Pull requests for adding batching are welcome.

Project contents

  • A Go package named concluder.
  • A web server with REST endpoints and a web frontend.
  • Several command line utilities, which were used for testing.

Utilities

These utilities were used for testing the functionality of the concluder package.

  • cmd/rec/rec was used for recording cmd/rec/output.wav which contains is a recording of me saying This meeting is about creating a llama farm..
  • cmd/wav2mp4/wav2mp4 was used for converting cmd/rec/output.wav to cmd/wav2mp4/output.mp4.
  • cmd/audio2text/audio2text was used for converting cmd/wav2mp4/output.wav to cmd/audio2text/output.txt.
  • cmd/conclude/conclude was used for converting cmd/audio2text/output.txt to cmd/conclude/output.txt.
  • cmd/slackpost/slackpost was used for posting cmd/conclude/output.txt to #nmp-meeting-concluder on Slack.
  • cmd/meetingconcluder/meetingconcluder records, converts, transcribes, concludes and posts to Slack.
  • cmd/play/play can play wav files, buy requires the afplay command.

General info

  • Author: Alexander F. Rødseth
  • License: Apache 2
  • Version: 1.0.2

The contents of the NOTICE file

(Required, per company policy).

################################################################################
#                                                                              #
# Meeting Concluder                                                            #
#                                                                              #
# Copyright 2023 Schibsted                                                     #
#                                                                              #
# 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.                                               #
#                                                                              #
################################################################################

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conclude

func Conclude(content string) (string, error)

func SendMeetingConclusion

func SendMeetingConclusion(conclusion string, startTime, endTime time.Time) error

func SendMessage

func SendMessage(message string) error

func TranscribeAudio

func TranscribeAudio(audioFilePath string) (string, error)

TranscribeAudio can extract the text from .mp4, .wav or several different audio file types

func TranscribeConvertConclude

func TranscribeConvertConclude(wavFileName, mp4FileName string, deleteWav, deleteMp4 bool) (string, error)

Types

type APIConfig

type APIConfig struct {
	OpenAIKey    string `toml:"openai_api_key"`
	SlackWebhook string `toml:"slack_webhook"`
}
var Config APIConfig

global configuration

type AsrResponse

type AsrResponse struct {
	Transcript string `json:"transcript"`
}

type AudioRecorder

type AudioRecorder struct {
	Recording bool

	StopRecordingCh chan struct{}
	// contains filtered or unexported fields
}

func NewAudioRecorder

func NewAudioRecorder() *AudioRecorder

func (*AudioRecorder) GetRecordedData

func (a *AudioRecorder) GetRecordedData() []byte

func (*AudioRecorder) GetRecordedDataTail

func (a *AudioRecorder) GetRecordedDataTail(length time.Duration) ([]byte, error)

func (*AudioRecorder) InputDevices

func (a *AudioRecorder) InputDevices() ([]*portaudio.DeviceInfo, error)

func (*AudioRecorder) IsRecording

func (a *AudioRecorder) IsRecording() bool

func (*AudioRecorder) ListenForClapSoundToStopRecording

func (a *AudioRecorder) ListenForClapSoundToStopRecording(nClaps int, onRecordingStop func())

func (*AudioRecorder) RecordAudio

func (a *AudioRecorder) RecordAudio(wavFileName string, maxRecord time.Duration, nClapsDetection int, onRecordingStop func()) error

func (*AudioRecorder) RecordToFile

func (a *AudioRecorder) RecordToFile(wavFilename string, maxDuration time.Duration, nClapDetection int, onRecordingStop func()) error

func (*AudioRecorder) SaveTailToWav

func (a *AudioRecorder) SaveTailToWav(length time.Duration, filename string) error

SaveTailToWav saves the last N seconds of the audio buffer to file

func (*AudioRecorder) SaveWav

func (a *AudioRecorder) SaveWav(filename string) error

func (*AudioRecorder) SetSelectedDevice

func (a *AudioRecorder) SetSelectedDevice(device *portaudio.DeviceInfo)

func (*AudioRecorder) StopRecording

func (a *AudioRecorder) StopRecording()

func (*AudioRecorder) Terminate

func (a *AudioRecorder) Terminate()

func (*AudioRecorder) UserSelectsTheInputDevice

func (a *AudioRecorder) UserSelectsTheInputDevice() error

func (*AudioRecorder) WaitForRecordingToStop

func (a *AudioRecorder) WaitForRecordingToStop()

type AudioResponse

type AudioResponse struct {
	Text string `json:"text"`
}

type OpenAIRequest

type OpenAIRequest struct {
	Model    string        `json:"model"`
	Messages []interface{} `json:"messages"`
}

type OpenAIResponse

type OpenAIResponse struct {
	Choices []struct {
		Message struct {
			Role    string `json:"role"`
			Content string `json:"content"`
		} `json:"message"`
	} `json:"choices"`
}

Directories

Path Synopsis
cmd
rec

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL