Replies: 2 comments
-
That code sets the MIDI device, not the audio device. They are very
different. MIDI is for connecting to mechanical peripherals like keyboards.
The microphone is an audio device. You cannot have the same audio device be
an input and an output on Android. Each device is either an input or an
output.
…On Tue, Nov 1, 2022, 3:45 AM smokbott ***@***.***> wrote:
In the fxLab sample this function assigns the output device, does anyone
know how to set the input device? By default the input device is the
microphone, but I want the input and output device to be the same, similar
to the LiveEffect sample where the default input and output device is the
same.
@RequiresApi(Build.VERSION_CODES.M)
private fun handleMidiDevices() {
val midiManager = getSystemService(Context.MIDI_SERVICE) as MidiManager
midiManager.registerDeviceCallback(object : MidiManager.DeviceCallback() {
override fun onDeviceAdded(device: MidiDeviceInfo) {
// open this device
midiManager.openDevice(device, {
Log.d(TAG, "Opened MIDI device")
val targetSeekBar = findViewById(R.id.seekBar)
if (targetSeekBar != null) {
val midiReceiver = MyMidiReceiver(targetSeekBar)
val outputPort = it.openOutputPort(0)
outputPort?.connect(midiReceiver)
}
}, Handler())
}
}, Handler())
}
—
Reply to this email directly, view it on GitHub
<#1646>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHPU2K5C3FYSU47SBJH2NTWGB76NANCNFSM6AAAAAARTU54F4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, I really had some confusion, since I'm getting to know the oboe library. In the same way if it is possible to use the same device as input and output: for example an external sound card. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Beta Was this translation helpful? Give feedback.
All reactions