Golang implementation of the NetMD protocol based on linux-minidisc and netmd-js.
Find a file
2026-07-12 09:54:02 +02:00
.gitignore added track count 2021-05-20 21:26:04 +02:00
device.go using own gousb fork 2021-06-07 16:43:11 +02:00
ekb.go license added 2021-05-19 13:58:03 +02:00
go.mod typo fix 2026-07-12 09:54:02 +02:00
go.sum module name changed 2026-07-12 09:40:24 +02:00
group.go group parsing added and many extra riff container analyses 2021-06-07 13:43:06 +02:00
IMPROVEMENTS.md fixed open issue and three critical problems 2026-07-12 09:33:11 +02:00
LICENSE license added 2021-05-19 13:58:03 +02:00
netmd.go using own gousb fork 2021-06-07 16:43:11 +02:00
nonce.go license added 2021-05-19 13:58:03 +02:00
README.md simplified the data exchange function to check all replies if they match the request 2021-06-03 11:37:14 +02:00
secure.go group parsing added and many extra riff container analyses 2021-06-07 13:43:06 +02:00
send.go fixed open issue and three critical problems 2026-07-12 09:33:11 +02:00
track.go fixed open issue and three critical problems 2026-07-12 09:33:11 +02:00
utils.go LP2 support 2021-05-24 10:46:12 +02:00

go-netmd library

This is a study and re-implementation library of the linux-minidisc and the netmd-js project in to go language.

I tried to simplify most code in a 'go' manner so understanding the NetMD protocol will be a bit easier for the next person who will try and do the same :-)

Usage

go get github.com/enimatek-nl/go-netmd-lib

Example

In this example we send a stereo pcm file to the NetMD device concurrently.

md, err := netmd.NewNetMD(0, false)
if err != nil {
    log.Fatal(err)
}
defer md.Close()

track, err := md.NewTrack("My Song", "song.wav")
if err != nil {
    log.Fatal(err)
}

switch track.Format {
case netmd.WfPCM:
    log.Println("PCM detected")
case netmd.WfLP2:
    log.Println("LP2 detected")
}

c := make(chan netmd.Transfer)
go md.Send(track, c)

for{
    res, ok := <-c
    if !ok {
        break
    }
    if res.Error != nil {
        log.Fatal(res.Error)
    }
    switch res.Type {
    case netmd.TtSend:
        log.Printf("Transferred %d of %d bytes", res.Transferred, track.TotalBytes())
    case netmd.TtTrack:
        log.Printf("Created a new track # %d ", res.Track)
    }
}

TODO

The library has only been tested with my Sony MZ-NH600 and the Sharp IM-DR420.

Some functions (eg. groups parsing of titles) are not implemented yet.