Compare commits

...

2 commits

Author SHA1 Message Date
Brandon Taylor
1fa1dd03cb no redundant tests 2022-03-09 17:05:09 -05:00
Brandon Taylor
78621620c9 work with vector buffers 2022-03-09 16:52:50 -05:00
2 changed files with 5 additions and 4 deletions

View file

@ -18,8 +18,6 @@ jobs:
matrix:
version:
- '1.3'
- '1.4'
- '1.5'
- '1'
- 'nightly'
os:

View file

@ -1005,6 +1005,9 @@ function exchange(messenger, arguments...)
take!(messenger.output_channel)
end
as_matrix(matrix::Matrix) = matrix
as_matrix(vector::Vector) = reshape(vector, length(vector), 1)
# these will only work with sampledsignals scribes
function unsafe_write(
sink::PortAudioSink{<:Messenger{<:Any, <:SampledSignalsWriter}},
@ -1012,7 +1015,7 @@ function unsafe_write(
already,
frame_count,
)
exchange(sink.stream.sink_messanger, julia_buffer, already, frame_count)
exchange(sink.stream.sink_messanger, as_matrix(julia_buffer), already, frame_count)
end
function unsafe_read!(
@ -1021,7 +1024,7 @@ function unsafe_read!(
already,
frame_count,
)
exchange(source.stream.source_messanger, julia_buffer, already, frame_count)
exchange(source.stream.source_messanger, as_matrix(julia_buffer), already, frame_count)
end
end # module PortAudio