We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3d57f2 commit 4281a2fCopy full SHA for 4281a2f
src/SampleBuf.jl
@@ -79,8 +79,10 @@ end
79
"""Get a pointer to the underlying data for the buffer. Will return a Ptr{T},
80
where T is the element type of the buffer. This is particularly useful for
81
passing to C libraries to fill the buffer"""
82
-channelptr(buf::SampleBuf, channel) =
83
- pointer(buf.data) + (channel-1)*nframes(buf) * sizeof(eltype(buf))
+channelptr(buf::Array, channel, frameoffset=0) =
+ pointer(buf) + ((channel-1)*nframes(buf)+frameoffset) * sizeof(eltype(buf))
84
+channelptr(buf::SampleBuf, channel, frameoffset=0) =
85
+ channelptr(buf.data, channel, frameoffset)
86
87
# the index types that Base knows how to handle. Separate out those that index
88
# multiple results
0 commit comments