Orion/orion.go

59 lines
1.6 KiB
Go

/*
Orion --- Speech to text bot
Copyright (c) 2022 Sameer Rahmani <lxsameer@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main
import (
"os"
"flag"
"log"
"fmt"
"lxsameer.com/go/orion/pkg/core"
)
var model = flag.String("model", "", "Path to the model (protocol buffer binary file)")
var scorer = flag.String("scorer", "", "Path to the external scorer")
var owner = flag.String("owner", "", "Telegram user id that is allowed to use this bot")
func main() {
flag.Parse()
log.SetFlags(0)
if *model == "" {
// In case of error print error and print usage
// This can also be done by passing -h or --help flags
fmt.Fprintf(flag.CommandLine.Output(), "Usage of %s:\n", os.Args[0])
flag.PrintDefaults()
return
}
// // Initialize Coqui
// m, err := asticoqui.New(*model)
// if err != nil {
// log.Fatal("Failed initializing model: ", err)
// }
// defer m.Close()
a1 := "/home/lxsameer/src/orion/2022-04-09_11:48:57.ogg"
a2 := "/home/lxsameer/src/orion/blah.wav"
err := core.ConvertOggtoWav(&a1, &a2)
if err != nil {
log.Fatal(err)
return
}
log.Println("done!")
}