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

Write-AudioDevice should be able to adjust -[Timespan]SampleInterval and return floats #66

Open
2 tasks
StartAutomating opened this issue Nov 28, 2022 · 3 comments

Comments

@StartAutomating
Copy link

StartAutomating commented Nov 28, 2022

Cool set of cmdlets! I've been looking for something like this for quite some time.

Write-AudioDevice hard codes a sleep of 100 milliseconds between samples. This is good enough for many purposes, but not great for analyzing the currently playing audio, thus

  1. Write-AudioDevice should have a [Timespan]SampleInterval parameter, defaulting to 100 milliseconds.

Additionally, it looks like Write-AudioDevice is converting the float value into a 0-100 range. Again, this is fine for a lot of cases, but it looses a lot of precision. Thus:

  1. Write-AudioDevice -PlaybackStream should be able to return floats

It might be nice to be able to get the entire sample buffer as well.

I'm happy to take this particular work item on, as both parts of it should be fairly straightforward.

@cdhunt
Copy link
Collaborator

cdhunt commented Nov 29, 2022

Hey James, Write-AudioDevice was something I threw together for a hackathon years ago and since then I've handed the project over to @frgnca. Out of curiosity, what are you looking to do that requires the additional precision?

@StartAutomating
Copy link
Author

@cdhunt @frgnca there are two major musical scenarios I'd like to put together with Write-AudioDevice:

  1. Integration with LightScript.

I've been building out a lot of smart lighting controlling code over the years. By being able to analyze playing audio in close to realtime, I should be able to make a music mode for lights that would work across multiple devices.

  1. Gameification.

Long story made short, with some details withheld, I'm looking at creating a new batch of games in PowerShell, and I want some of them to use synchronization with music to affect score (a la Rock Band / Guitar Hero / a million and one games since).

By the way, I haven't had any luck getting this code to build just yet. Does anyone have a .csproj for the repo?

StartAutomating pushed a commit to StartAutomating/AudioDeviceCmdlets that referenced this issue Dec 10, 2022
…. Support for mutlichannel (Fixes frgnca#67).  Internal refactoring (Fixes frgnca#68)
@cdhunt
Copy link
Collaborator

cdhunt commented Dec 14, 2022

Here's the sln and csproj from back in the day before @frgnca reorganized the project.

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

2 participants