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

Add microphone support #1

Open
Neuron1k opened this issue Nov 30, 2016 · 0 comments
Open

Add microphone support #1

Neuron1k opened this issue Nov 30, 2016 · 0 comments

Comments

@Neuron1k
Copy link
Owner

Neuron1k commented Nov 30, 2016

Można zrobić wczytywanie głosu przez apkę i wyświetlenie wieku mówcy.

http://www.rforge.net/audio/

# record 8000 samples at 8000Hz (1 sec), mono (1 channel)
a <- record(8000, 8000, 1)
wait(a) # wait for the recording to finish
x <- a$data # get the result
x[1:10] # show first ten samples
#sample rate: 8000Hz, mono, 16-bits
# [1] 0.018100981 0.017364085 0.016479610 0.013326526 0.010764275 0.011048204
# [7] 0.010541249 0.010892886 0.007960078 0.006703259
close(a); rm(a) # you can close the instance at this point
play(x) # play back the result
# amplify and crop the signal
y <- x * 2
y[y < -1] <- -1
y[y > 1] <- 1
# play the amplified signal
play(y)
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

1 participant