GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — make AudioDeviceManager and Engine public - enable Sound.getOutputDevices() · Issue #94 · processing/processing-sound

make AudioDeviceManager and Engine public - enable Sound.getOutputDevices() #94

New issue
Copy link
New issue
Copy link
Open
Open
make AudioDeviceManager and Engine public - enable Sound.getOutputDevices()#94
Copy link
Labels
documentation

Description

@trackme518
trackme518
opened on Dec 13, 2023
Issue body actions

Engine.AudioDeviceManager audioManager = Sound.getAudioDeviceManager();
Get me an error: The type Engine is not visible

I would like to list and filter audio devices myself - specifically I want to list only output devices so I can create GUI for the user with list of devices to choose from.

I also want to be able to retrieve the individual device and for that I need to know the type - input or output.
AudioDevice device = Engine.getEngine().outputDevice(i);

So ideally there would be method Sound.getOutputDevices() and Sound.getInputDevices() that would return the array of AudioDevice type. I can than loop through them, check their properties and decide what to do (like checking how many outputs it has, name, id, samplerate).

Activity

  1. trackme518
    changed the title [-]make AudioDeviceManager public[/-] [+]make AudioDeviceManager public - enable Sound.getOutputDevices()[/+] on Dec 13, 2023
  2. trackme518
    changed the title [-]make AudioDeviceManager public - enable Sound.getOutputDevices()[/-] [+]make AudioDeviceManager and Engine public - enable Sound.getOutputDevices()[/+] on Dec 13, 2023
  3. kevinstadler commented on Dec 13, 2023

    @kevinstadler
    kevinstadler
    on Dec 13, 2023
    Collaborator
    More actions

    Hello,

    reading the number of output channels for a device is already possible through the MultiChannel.availableChannels(deviceId) method (all programmatic low-level information methods are in the MultiChannel class, in order not to overload the Sound class which has all options/settings that should suffice for basic users).

    Just to clarify: there is no categorical distinction between input devices and output devices -- there is only one global list of audio devices, where any audio device has 0 or more input channels as well as 0 or more output channels. So it's possible that a device (notably most basic sound cards) are both an input and an output device at the same time. To test whether a given device from the global list is an "output device", one just needs to check whether the number of output channels is > 0, which can be done with the method above.

    If you want to handle the AudioDeviceManager yourself, it doesn't actually make filtering for "output devices" any easier, but you can already do that -- it's not actually an internal class, it's the underlying JSyn object, so you'll just need to use the correct import (I will make sure to add that to the existing LowLevelEngine example, thanks!):

    import com.jsyn.devices.AudioDeviceManager;
    
    ...
    
    AudioDeviceManager audioManager = Sound.getAudioDeviceManager();
  4. kevinstadler
    added
    documentation
    on Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.