ports AudioInput to new type structure
This commit is contained in:
parent
afe4e0d8be
commit
9312fa745d
1 changed files with 16 additions and 19 deletions
35
src/nodes.jl
35
src/nodes.jl
|
@ -150,22 +150,19 @@ function play{T <: Unsigned}(arr::Array{T}, args...)
|
|||
play(arr, args...)
|
||||
end
|
||||
|
||||
##### AudioInput ####
|
||||
#
|
||||
## Renders incoming audio input from the hardware
|
||||
#
|
||||
#export AudioInput
|
||||
#type AudioInput <: AudioNode
|
||||
# active::Bool
|
||||
# deactivate_cond::Condition
|
||||
# channel::Int
|
||||
#
|
||||
# function AudioInput(channel::Int)
|
||||
# new(false, Condition(), channel)
|
||||
# end
|
||||
#end
|
||||
#
|
||||
#function render(node::AudioInput, device_input::AudioBuf, info::DeviceInfo)
|
||||
# @assert size(device_input, 1) == info.buf_size
|
||||
# return device_input[:, node.channel], is_active(node)
|
||||
#end
|
||||
#### AudioInput ####
|
||||
|
||||
# Renders incoming audio input from the hardware
|
||||
|
||||
type InputRenderer <: AudioRenderer
|
||||
channel::Int
|
||||
end
|
||||
|
||||
function render(node::InputRenderer, device_input::AudioBuf, info::DeviceInfo)
|
||||
@assert size(device_input, 1) == info.buf_size
|
||||
return device_input[:, node.channel]
|
||||
end
|
||||
|
||||
typealias AudioInput AudioNode{InputRenderer}
|
||||
AudioInput(channel::Int) = AudioInput(InputRenderer(channel))
|
||||
export AudioInput
|
||||
|
|
Loading…
Reference in a new issue