A track to download to the recorder, ported from netmd-js's MDTrack.
Audio data must already be in the wire format: raw PCM (big-endian 16-bit stereo at 44100 Hz) or pre-encoded ATRAC3 for the LP modes. Packets are encrypted with a random key wrapped by the key encryption key, chained CBC across chunks.
Summary
Functions
The content ID all open implementations use.
Default disc format byte for the track's wire format.
Number of frames in the (padded) data.
Frame size in bytes for the track's wire format.
The key encryption key all open implementations use.
Stream of {key, iv, encrypted_data} packets for NetMD.Interface.send_track/8.
Data size in bytes, padded up to a whole number of frames.
Wire format byte sent to the device.
Types
@type format() :: :pcm | :l105kbps | :lp2 | :lp4
Wire format of the audio data.
@type t() :: %NetMD.Track{ chunk_size: pos_integer(), data: binary(), format: format(), full_width_title: String.t() | nil, raw_key: <<_::64>> | nil, title: String.t() }
A track ready for download.
Functions
@spec content_id() :: <<_::160>>
The content ID all open implementations use.
Default disc format byte for the track's wire format.
@spec frame_count(t()) :: non_neg_integer()
Number of frames in the (padded) data.
@spec frame_size(t()) :: pos_integer()
Frame size in bytes for the track's wire format.
@spec kek() :: <<_::64>>
The key encryption key all open implementations use.
@spec packets(t()) :: Enumerable.t()
Stream of {key, iv, encrypted_data} packets for NetMD.Interface.send_track/8.
The data is encrypted with a random key (set :raw_key on the struct
for a deterministic stream); the packet key is that key unwrapped with
the KEK. The IV chains from the last ciphertext block of the previous
chunk.
@spec total_size(t()) :: pos_integer()
Data size in bytes, padded up to a whole number of frames.
Wire format byte sent to the device.