Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Need Windows/Linux audio support ASAP :) #6

Open
yupferris opened this issue Nov 9, 2015 · 6 comments
Open

Need Windows/Linux audio support ASAP :) #6

yupferris opened this issue Nov 9, 2015 · 6 comments

Comments

@yupferris
Copy link
Member

I've started looking at how to add this, which led me to CPAL. I started playing with it, and ran into some problems; refer to the discussion here.

@yupferris yupferris changed the title Need Windows/Linux support ASAP :) Need Windows/Linux audio support ASAP :) Nov 9, 2015
@yupferris
Copy link
Member Author

One of the core issues is the fact that certain platforms won't be able to support the correct sample format/sampling rate that different emulators require (for instance snes-apu, which requires a 32000hz sample rate).

The emulators themselves could implement their own resampling, but I think this is the wrong approach, as I foresee it being a common issue. I also don't think the various cross-platform audio abstraction API's should try to do this, as they should be concerned with bridging the platform gap, and nothing else. This library, however, sits right in the middle, and should bridge the gap between the emulators' needs and the capabilities of the current platform - so I think this is the perfect place to support resampling internally if necessary.

As far as the actual resampling itself goes, it looks like rodio exposes a sources/sinks-based API that includes a resampler, so that's worth looking into for sure. I haven't dug into the code to see what kinds of resampling modes it actually supports, and that's worth following up on.

@est31
Copy link

est31 commented Nov 26, 2017

Hi! Two points:

  • cpal has integrated coreaudio support again
  • I've read that this library uses coreaudio-rs only for the example. Maybe add it as a dev-dependency then instead? Then anyone who depends on the library doesn't have to build any of the playback dependencies :).

@yupferris
Copy link
Member Author

yupferris commented Nov 27, 2017

I think you're referring to this crate (emu) being a dev-dependency for https://github.com/emu-rs/snes-apu ?

My current thoughts are that this set of libs isn't really very well thought-out at the moment, and I'm not really working on it, so I'd rather consider changing snes-apu to using cpal as a dev-dependency instead, and drop the emu libs altogether (at least for now). Thoughts?

@est31
Copy link

est31 commented Nov 27, 2017

@yupferris that approach sounds good with me :)

@yupferris
Copy link
Member Author

Cool, I'll look into removing the dependency on this crate in the next couple days then. In the meantime though, as I've said before, snes-apu still only depends on emu as a dev-dependency, and thus should work fine as-is.

@est31
Copy link

est31 commented Nov 27, 2017

@yupferris I see, thanks :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants