first commit

This commit is contained in:
Octopus Octopus 2024-03-07 15:54:01 -06:00
commit f2351a7fac
4 changed files with 44 additions and 0 deletions

BIN
fvcrm Executable file

Binary file not shown.

8
go.mod Normal file
View File

@ -0,0 +1,8 @@
module fvcrm
go 1.22.1
require (
github.com/go-flac/flacvorbis v0.2.0
github.com/go-flac/go-flac v1.0.0
)

4
go.sum Normal file
View File

@ -0,0 +1,4 @@
github.com/go-flac/flacvorbis v0.2.0 h1:KH0xjpkNTXFER4cszH4zeJxYcrHbUobz/RticWGOESs=
github.com/go-flac/flacvorbis v0.2.0/go.mod h1:uIysHOtuU7OLGoCRG92bvnkg7QEqHx19qKRV6K1pBrI=
github.com/go-flac/go-flac v1.0.0 h1:6qI9XOVLcO50xpzm3nXvO31BgDgHhnr/p/rER/K/doY=
github.com/go-flac/go-flac v1.0.0/go.mod h1:WnZhcpmq4u1UdZMNn9LYSoASpWOCMOoxXxcWEHSzkW8=

32
main.go Normal file
View File

@ -0,0 +1,32 @@
package main
import (
"log"
"os"
flacvorbis "github.com/go-flac/flacvorbis"
"github.com/go-flac/go-flac"
)
func main() {
f, err := flac.ParseFile(os.Args[1])
if err != nil {
panic(err)
}
var cmt *flacvorbis.MetaDataBlockVorbisComment
for _, meta := range f.Meta {
if meta.Type == flac.VorbisComment {
cmt, err = flacvorbis.ParseFromMetaDataBlock(*meta)
if err != nil {
panic(err)
}
log.Printf("found comments %v.\n", cmt.Comments)
cmt.Comments = nil
meta.Data = cmt.Marshal().Data
log.Printf("removed comments.")
}
}
f.Save(os.Args[1])
}