Documentation ¶
Overview ¶
Package dsf implements a DSF (DSD Stream File) audio decoder and encoder.
See "DSF File Format Specification", v1.01, Sony Corporation:
http://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataChunk ¶
type DataChunk struct { // data chunk header. // 'd' , 'a' , 't', 'a '. Header [4]byte // Size of this chunk. Size [8]byte }
DataChunk is the file structure of the data chunk within a DSD stream file, excluding the variable length sample data. See "DSF File Format Specification", v1.01, Sony Corporation. All data is little-endian. This is exported to allow reading with binary.Read.
type DsdChunk ¶
type DsdChunk struct { // DSD chunk header. // 'D' , 'S' , 'D', ' ' (includes 1 space). Header [4]byte // Size of this chunk. // 28 bytes. Size [8]byte // Total file size. TotalFileSize [8]byte // Pointer to Metadata chunk. // If Metadata doesn’t exist, set 0. If the file has ID3v2 tag, then set the // pointer to it. ID3v2 tag should be located in the end of the file. MetadataPointer [8]byte }
DsdChunk is the file structure of the DSD chunk within a DSD stream file. See "DSF File Format Specification", v1.01, Sony Corporation. All data is little-endian. This is exported to allow reading with binary.Read.
type FmtChunk ¶
type FmtChunk struct { // fmt chunk header. // 'f' , 'm' , 't' , ' ' (includes 1 space). Header [4]byte // Size of this chunk. // Usually 52 bytes. Size [8]byte // Format version. // 1. Version [4]byte // Format id. // 0: DSD raw. Identifier [4]byte // Channel type. // 1: mono // 2: stereo // 3: 3 channels // 4: quad // 5: 4 channels // 6: 5 channels // 7: 5.1 channels ChannelType [4]byte // Channel num. // 1: mono // 2: stereo // ... // 6: 6 channels ChannelNum [4]byte // Sampling frequency in Hertz. // 2822400, 5644800, 11289600 or 22579200. SamplingFrequency [4]byte // Bits per sample. // 1 or 8. BitsPerSample [4]byte // Sample count. // This is for 1 channel e.g. for n seconds of data: // SampleCount = SamplingFrequency * n. SampleCount [8]byte // Block size per channel. // 4096, unused samples should be filled with zero. BlockSize [4]byte // Reserved. // Filled with zero. Reserved [4]byte }
FmtChunk is the file structure of the fmt chunk within a DSD stream file. See "DSF File Format Specification", v1.01, Sony Corporation. All data is little-endian. This is exported to allow reading with binary.Read.