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

Speaker does not have play(tone, duration) method #35

Closed
tomaszrykala opened this issue Jan 25, 2017 · 6 comments
Closed

Speaker does not have play(tone, duration) method #35

tomaszrykala opened this issue Jan 25, 2017 · 6 comments
Labels

Comments

@tomaszrykala
Copy link
Contributor

The readme for PWM Speaker describes an overloaded play() method that takes a tone and a duration as arguments. The driver however, supplies only a method that allows the tone.

readme source:
https://github.com/androidthings/contrib-drivers/tree/master/pwmspeaker

extract:

// Make it play:

try {
    mSpeaker.play(440 /* tone */, 3000L /* duration */);
} catch (IOException e) {
    // error setting speaker
}

The only currently existing method:

    public void play(double frequency) throws IOException, IllegalStateException {
...
    }
@proppy
Copy link
Contributor

proppy commented Jan 26, 2017

Sounds like a documentation bug :)

@tomaszrykala
Copy link
Contributor Author

Can update the documentation to address this, but is there somehow we could expand on this, admiteddly not ideal, solution? #36

@tomaszrykala
Copy link
Contributor Author

Thank you for the input. I will update the documentation in the meantime.

@mangini
Copy link
Contributor

mangini commented Jan 27, 2017

@tomaszrykala Supporting duration essentially means having a sequencer in a separate thread that handles the timers, so it's not trivial. We have an initial implementation in our internal code review. Can you open a separate "enhancement" issue so we can keep track of it? Thanks!

@tomaszrykala
Copy link
Contributor Author

@mangini Here it is. #38 Thanks.

@tomaszrykala
Copy link
Contributor Author

This is closed by #37

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

No branches or pull requests

3 participants