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

Implement sample play command #36

Merged
merged 1 commit into from
Jan 11, 2020
Merged

Conversation

mraerino
Copy link
Contributor

This exposes the c api command pa_context_play_sample from the library

the volume parameter is actually different than in other commands so I decided to always pass "keep volume".

@mk-fg mk-fg merged commit a50df3a into mk-fg:master Jan 11, 2020
@mk-fg
Copy link
Owner

mk-fg commented Jan 11, 2020

Thanks.

I'll probably tweak it a bit to not have extra _method there, accept None as default sink and volume as the usual float arg.

@mk-fg
Copy link
Owner

mk-fg commented Jan 11, 2020

Also, wonder if you might want to use libcanberra for such samples instead - check it out, if you haven't.

@mraerino mraerino deleted the feat/play-sample branch January 11, 2020 16:23
@mraerino
Copy link
Contributor Author

thanks for the really fast merge! are you going to do a release?

@mk-fg
Copy link
Owner

mk-fg commented Jan 11, 2020

Yup, just did, should be 20.1.2 on pypi (when it updates its caches).

@mk-fg
Copy link
Owner

mk-fg commented Jan 11, 2020

Check out 4776712 btw for changes in the fuction signature.
Should work with same args as you had though, but sink is optional (None = default one) and allows for volume/proplist.

@mk-fg
Copy link
Owner

mk-fg commented Jan 11, 2020

Loading sample via pulse API is probably way too complicated for this module, as you'd probably want to look it up in XDG theme dirs, add some proplist stuff from that, then decode whatever format (mp3, ogg, flac, wav, etc) and send that to pulse in async fashion, but guess you already do loading via some other means.

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

Successfully merging this pull request may close these issues.

None yet

2 participants