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

Adds support for microphone input #54

Closed
wants to merge 9 commits into from
Closed

Adds support for microphone input #54

wants to merge 9 commits into from

Conversation

mthelm85
Copy link
Contributor

@mthelm85 mthelm85 commented Oct 12, 2020

Hallo, Fons!

I've added support for the microphone input but I'm certain it will need some additional work. With this PR, users can do:

@bind audio Microphone()

This returns an array that constantly updates with the audio streaming from the microphone. To visualize the data, you might do something like this:

using Plots, SampledSignals

plot(domain(SampleBuf(Array(audio), 44100)), SampleBuf(Array(audio), 44100), legend=false, ylims=(-1,1))

This (kind of) resolves issue #16

Groetjes!

@mthelm85 mthelm85 mentioned this pull request Oct 12, 2020
@fonsp
Copy link
Member

fonsp commented Nov 5, 2020

The code contains merge conflicts, can you fix it? I can help if you're stuck

@mthelm85
Copy link
Contributor Author

mthelm85 commented Nov 5, 2020

Hmmm, on my end it says there are no conflicts..??? Should I re-submit the PR?

@mthelm85
Copy link
Contributor Author

mthelm85 commented Nov 9, 2020

Okay, I think I fixed it. I'm not sure why sometimes when I create pull requests I get these lines inserted into my code (obviously it's due to my lack of understanding of Git/GitHub):

<<<<<<HEAD

>>>>>#some random string

@mthelm85
Copy link
Contributor Author

mthelm85 commented Dec 3, 2020

bump. Is there still a merge conflict?

@fonsp
Copy link
Member

fonsp commented Dec 29, 2020

Thanks! Can you move it to a separate file?

@mthelm85
Copy link
Contributor Author

How's this?

@fonsp fonsp closed this Mar 11, 2021
@fonsp fonsp deleted the branch JuliaPluto:master March 11, 2021 21:39
@mbauman
Copy link

mbauman commented Jul 10, 2024

This is great! What would be needed to resurrect this PR? I recently used this for a training and would love to have it in PlutoUI.jl.

https://gist.github.com/mbauman/f50e0fcc20a2a16fd7e9a015f9cc54c1

Example notebook: https://juliahub.com/ui/Notebooks/mbauman3/public/Mic%20Input.jl

@fonsp
Copy link
Member

fonsp commented Oct 7, 2024

Hey! I think the TODOs are:

  • Rewrite to use HypertextLiteral
  • Place in separate file
  • Think about what value type to return: Vector{UInt8} or something from the audio packages? (With AbstractPlutoDingetjes.Bonds.transform_value)
  • Implement a default value with AbstractPlutoDingetjes.Bonds.default_value
  • Documentation with usage example, including how to play the recorded snippet

The code as-is works, but with the items above it becomes more user-friendly :)

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.

3 participants