Skip to content

Commit c5c70ed

Browse files
committed
adds metadata generic function
1 parent 6af2bd1 commit c5c70ed

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/SampledSignals.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export SampleBufSource, SampleBufSink
1010
export SinSource
1111
export Interval, ..
1212
# general methods for types in SampledSignals
13-
export samplerate, samplerate!, nchannels, nframes, domain, channelptr, blocksize
13+
export samplerate, samplerate!, nchannels, nframes
14+
export domain, channelptr, blocksize, metadata
1415
export mix!, mix, mono!, mono
1516
# re-export the useful units
1617
export ns, ms, µs, s, Hz, kHz, MHz, GHz, THz
@@ -47,4 +48,16 @@ function __init__()
4748
end
4849
end
4950

51+
"""
52+
metadata(x, key::Symbol)
53+
metadata(x, key::Symbol, idx)
54+
55+
Provide implementation-specific metadata for the given buffer or stream. For
56+
instance, data from a WAV file might have metadata that comes from extra chunks
57+
read from the file. If no `idx` is given then the first piece of metadata
58+
matching the key is returned. If there are multiple matches, the user can
59+
provide an index, or `:` to return a list of all matching metadata.
60+
"""
61+
function metadata end
62+
5063
end # module

0 commit comments

Comments
 (0)