Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Input, Output and Duplex stream types #116

Closed
2 of 3 tasks
mitchmindtree opened this issue Jul 21, 2016 · 2 comments
Closed
2 of 3 tasks

Support Input, Output and Duplex stream types #116

mitchmindtree opened this issue Jul 21, 2016 · 2 comments

Comments

@mitchmindtree
Copy link
Member

mitchmindtree commented Jul 21, 2016

Currently CPAL is oriented towards supporting output streams, i.e. Voice -> EndPoint. This is understandable considering CPALs user-base seems to be largely game devs so far.

If we do wish to target a more general audio audience we should also aim to equally support Input and Duplex streams. We might be able to get away with only Input and Output if we provide a nice API for "zipping" or "sync"ing them for cases where they share the same device.

@mitchmindtree
Copy link
Member Author

I'm currently sketching out an updated CPAL API that handles input, output and duplex streams. Below is a pseudo-code sketch. It omits some details like results, and I can imagine implementing this without any of the duplex API at first at least.

Global API

  • devices : [Device]
  • input_devices : [Device]
  • output_devices : [Device]
  • duplex_devices : [Device]
  • default_input_device : Option Device
  • default_output_device : Option Device
  • default_duplex_device : Option Device

Device API

  • name : String
  • uuid : Option String
  • manufacturer : Option String
  • default_input_format : Option Format
  • default_output_format : Option Format
  • default_duplex_format : Option Format
  • supported_input_formats : [SupportedFormat]
  • supported_output_formats : [SupportedFormat]
  • supported_duplex_formats : [SupportedFormat]

EventLoop API

  • new : EventLoop
  • build_input_stream : Device -> Format -> StreamId
  • build_output_stream : Device -> Format -> StreamId
  • build_duplex_stream : Device -> DuplexFormat -> StreamId
  • destroy_stream : StreamId
  • play_stream : StreamId
  • pause_stream : StreamId
  • run : Stream -> () -> !
    Stream = Output StreamId Buffer | Input StreamId Buffer

@mitchmindtree
Copy link
Member Author

Input and output are quite well supported now compared to when this issue was first opened - going to close this in favour of tracking duplex support at #349.

@ollpu ollpu mentioned this issue Mar 16, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant