riff

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package riff reads and umarshalls RIFF files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal is a mirror of json.Unmarshal, for RIFF files

Types

type INFO

type INFO struct {
	// Arhcival Location
	IARL string `riff:"IARL"`
	// Arist
	IART string `riff:"IART"`
	// Commissioned By
	ICMS string `riff:"ICMS"`
	// Comments
	ICMT string `riff:"ICMT"`
	// Copyright
	ICOP string `riff:"ICOP"`
	// Creation Date
	ICRD string `riff:"ICRD"`
	// Engineer
	IENG string `riff:"IENG"`
	// Genre
	IGNR string `riff:"IGNR"`
	// Keywords
	IKEY string `riff:"IKEY"`
	// Medium
	IMED string `riff:"IMED"`
	// Name
	INAM string `riff:"INAM"`
	// Product
	IPRD string `riff:"IPRD"`
	// Subject
	ISBJ string `riff:"ISBJ"`
	// Software
	ISFT string `riff:"ISFT"`
	// Source
	ISRC string `riff:"ISRC"`
	// Source Form
	ISRF string `riff:"ISRF"`
	// Technician
	ITCH string `riff:"ITCH"`
}

INFO is a common RIFF component. Most of these fields will be absent on any given INFO struct. Todo: consider if these should be given names that are informative instead of representative of their structural tag

type Reader

type Reader struct {
	*bytes.Reader
}

A Reader is a bytes reader with some helper functions to read IDs, Lens, and Data from RIFF files.

func NewReader

func NewReader(data []byte) *Reader

NewReader returns an initial Reader

func (*Reader) NextID

func (r *Reader) NextID() (string, error)

NextID returns the next four byte sof the reader as a string

func (*Reader) NextIDLen

func (r *Reader) NextIDLen() (string, uint32, bool, error)

NextIDLen returns NextID and NextLen

func (*Reader) NextLen

func (r *Reader) NextLen() (uint32, error)

NextLen returns the next four bytes of the reader as a length.

func (*Reader) Print

func (r *Reader) Print()

Print prints a reader without any knowledge of the structure of the reader, so all values will be []bytes. It assumes the reader has not advanced at all. Todo: Change that

Jump to

Keyboard shortcuts

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